ci: add github worflow for creating a release #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Pre-release | |
on: | |
pull_request: | |
jobs: | |
prerelease: | |
name: Pre-release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
# checkout merge request HEAD instead of merge commit | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Get Next Version | |
id: semver | |
uses: ietf-tools/semver-action@v1 | |
if: ${{ !env.ACT }} | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: master | |
- name: Short SHA | |
id: short_sha | |
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Update CHANGELOG | |
id: changelog | |
uses: requarks/changelog-action@v1 | |
with: | |
tag: ${{ github.ref_name }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build artifacts | |
run: make version=${{ steps.semver.outputs.next }}-pre-${{ steps.short_sha.outputs.short_sha }} artifact | |
- name: Create Draft Release | |
uses: ncipollo/release-action@v1 | |
if: ${{ !env.ACT }} | |
with: | |
allowUpdates: true | |
artifacts: "rf-liquidsoap*.tar.gz" | |
body: ${{ steps.changelog.outputs.changes }} | |
commit: ${{ github.event.pull_request.head.sha }} | |
draft: true | |
makeLatest: false | |
name: ${{ steps.semver.outputs.next }}-pre-${{ github.head_ref }} | |
prerelease: true | |
removeArtifacts: true | |
replacesArtifacts: true | |
tag: ${{ steps.semver.outputs.next }}-pre-${{ github.head_ref }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
updateOnlyUnreleased: true |