diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f69a8409..9643e414 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,6 +9,8 @@ on: jobs: validation: runs-on: ubuntu-20.04 + outputs: + commitid: ${{steps.commitid.outputs.short}} steps: - name: Setup Dynamic Env run: | @@ -61,3 +63,85 @@ jobs: with: name: hook-${{steps.commitid.outputs.short}} path: out/${{steps.commitid.outputs.short}}/rel/hook_*.tar.gz + + publish-release-latest: + runs-on: ubuntu-20.04 + if: github.ref == 'refs/heads/main' + needs: validation + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: hook-${{needs.validation.outputs.commitid}} + + - name: Delete Tag + run: | + git tag -d latest || echo "no local tag to delete" + git push origin :latest -f || echo "no remote tag to delete" + + - name: Generate Release Notes + run: | + generated_release_notes=$(gh api 'repos/{owner}/{repo}/releases/generate-notes' -F tag_name=latest --jq .body) + cat >>"$GITHUB_ENV" <<-EOF + RELEASE_NOTES<>"$GITHUB_ENV" <<-EOF + RELEASE_NOTES<