Skip to content

Commit

Permalink
.github: use ncipollo/release-action
Browse files Browse the repository at this point in the history
The actions/create-release is deprecated, use ncipollo/release-action
instead which is both smaller and a lot simpler to use.

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Apr 10, 2023
1 parent eabfb20 commit c5ef540
Showing 1 changed file with 9 additions and 33 deletions.
42 changes: 9 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,7 @@ on:

jobs:
release:
name: Create GitHub release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_id: ${{ steps.create_release.outputs.id }}
steps:
- uses: actions/checkout@v3
- name: Extract ChangeLog entry ...
# Hack to extract latest entry for body_path below
run: |
awk '/-----*/{if (x == 1) exit; x=1;next}x' ChangeLog.md \
|head -n -1 > release.md
cat release.md
- name: Create release ...
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Mg ${{ github.ref }}
body_path: release.md
draft: false
prerelease: false
tarball:
name: Build and upload release tarball
needs: release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
Expand All @@ -48,10 +21,13 @@ jobs:
make release
mkdir -p artifacts/
mv ../*.tar.* artifacts/
- name: Upload release artifacts ...
uses: skx/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Extract ChangeLog entry ...
run: |
awk '/-----*/{if (x == 1) exit; x=1;next}x' ChangeLog.md \
|head -n -1 > release.md
cat release.md
- uses: ncipollo/release-action@v1
with:
releaseId: ${{ needs.release.outputs.release_id }}
args: artifacts/*
name: Mg ${{ github.ref_name }}
bodyFile: "release.md"
artifacts: "artifacts/*"

0 comments on commit c5ef540

Please sign in to comment.