Skip to content

Commit

Permalink
feat(CI): Publish releases after successful builds
Browse files Browse the repository at this point in the history
  • Loading branch information
FiniteReality committed Feb 25, 2022
1 parent ee2407b commit 8d62341
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
runs-on: ubuntu-latest

outputs:
release: ${{ steps.tag_version.outputs.new_tag }}
tag: ${{ steps.tag_version.outputs.new_tag }}
id: ${{ steps.create_release.outputs.id }}

steps:
- uses: actions/checkout@v2
Expand All @@ -21,6 +22,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}

- uses: ncipollo/release-action@v1
id: create_release
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Fabulist ${{ steps.tag_version.outputs.new_tag }}
Expand Down Expand Up @@ -72,6 +74,9 @@ jobs:
os: [ windows-latest, ubuntu-latest ]
lua: [ "5.1", "5.2", "5.3", "5.4" ]

outputs:
release-id: ${{ needs.create-release.outputs.id }}

steps:
- uses: actions/download-artifact@v2
with:
Expand Down Expand Up @@ -99,6 +104,15 @@ jobs:
cd ..
- name: Add merged artifacts to release
run: gh release upload "${{ needs.create-release.outputs.release }}" "fabulist-${{ matrix.os }}-lua${{ matrix.lua }}.zip" --repo "$GITHUB_REPOSITORY"
run: gh release upload "${{ needs.create-release.outputs.tag }}" "fabulist-${{ matrix.os }}-lua${{ matrix.lua }}.zip" --repo "$GITHUB_REPOSITORY"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-release:
needs: merge-artifacts
runs-on: ubuntu-latest

steps:
- run: gh api "repos/$GITHUB_REPOSITORY/releases/${{ needs.merge-artifacts.outputs.release-id }}" -X PATCH -F draft=false --silent
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 8d62341

Please sign in to comment.