ansible-cron/.forgejo/workflows/Publish Collection.yml
GregoryDosh 5f56f9342b
All checks were successful
Version Bump Galaxy.yml / Version Bump Galaxy.yml (push) Successful in 8s
Publish Collection / Publish Collection (push) Successful in 9s
Initial Dosh LLC Config 🌈🐻
2025-11-24 14:42:45 -06:00

83 lines
2.8 KiB
YAML

# SPDX-License-Identifier: AGPL-3.0-or-later
# SPDX-FileCopyrightText: 2025 Dosh LLC
---
name: Publish Collection
on:
push:
branches:
- main
paths:
- galaxy.yml
jobs:
publish-collection:
name: Publish Collection
runs-on: ubuntu-act-latest
if: ${{ secrets.REPO_PUBLISH_TOKEN != '' }}
steps:
- name: Clone Repo into Workspace
uses: https://git.auengun.net/actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0
fetch-tags: true
- name: Create Env Vars
shell: bash
run: |
{
printf "RELEASE_TAG="
grep version: galaxy.yml | cut -f 2 -d":" | sed -e 's/^[[:space:]]*//'
} >> "$GITHUB_ENV"
{
printf "RELEASE_PREV_TAG="
git describe `git rev-list --tags --no-walk --skip=0` --tags --exact-match | head -n 1
} >> "$GITHUB_ENV"
{
printf "COMMITS_SINCE_TAG="
git rev-list `git rev-list --tags --no-walk --skip=1 --max-count=1`..HEAD --count
} >> "$GITHUB_ENV"
cat "$GITHUB_ENV"
- name: Create Release Notes
id: release_notes
shell: bash
run: |
{
echo "RELEASE_NOTES<<EOF"
git log -n ${{ env.COMMITS_SINCE_TAG }} --pretty=%B | grep -v "chore(release)" || echo "<!-- No Release Notes -->"
echo "EOF"
} | tee -a "$GITHUB_OUTPUT"
echo "Saved to $GITHUB_OUTPUT"
- name: Create Release & Vet License Headers
id: create_release
shell: bash
run: |
make release
{
echo "RELEASE_SHA<<EOF"
cat release/*.zip.sha256
echo "EOF"
} | tee -a "$GITHUB_OUTPUT"
echo "Saved to $GITHUB_OUTPUT"
- name: Push Release to Forgejo
uses: https://git.auengun.net/actions/forgejo-release@fc0488c944626f9265d87fbc4dd6c08f78014c63 # v2.7.3
with:
token: ${{ secrets.REPO_PUBLISH_TOKEN }}
direction: upload
override: true
release-dir: release
tag: ${{ env.RELEASE_TAG }}
title: ${{ env.RELEASE_TAG }}
hide-archive-link: true
release-notes: |
# [Release ${{ env.RELEASE_TAG }}](${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ env.RELEASE_TAG }})
${{ steps.release_notes.outputs.RELEASE_NOTES }}
**sha256** `${{ steps.create_release.outputs.RELEASE_SHA }}`
---
[${{ github.repository }}](${{ github.server_url }}/${{ github.repository }}) ${{ github.server_url }}/${{ github.repository }}/src/commit/${{ github.sha }} [${{ env.RELEASE_PREV_TAG }}...${{ env.RELEASE_TAG }}](${{ github.server_url }}/${{ github.repository }}/compare/${{ env.RELEASE_PREV_TAG }}...${{ env.RELEASE_TAG }})