-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add github worflow for creating a release release
- Loading branch information
Gilbert MINH
committed
Apr 19, 2024
1 parent
fb3f640
commit e114fd6
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
name: Release | ||
on: # yamllint disable-line rule:truthy | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-release: | ||
name: Build & Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get Next Version | ||
id: semver | ||
uses: ietf-tools/semver-action@v1 | ||
if: ${{ !env.ACT }} | ||
with: | ||
token: ${{ github.token }} | ||
branch: master | ||
|
||
- name: Build artifacts | ||
run: make version=${{ steps.semver.outputs.next }} artifact | ||
|
||
- name: Create Draft Release | ||
uses: ncipollo/release-action@v1.12.0 | ||
if: ${{ !env.ACT }} | ||
with: | ||
artifacts: "rf-liquidsoap*.tar.gz" | ||
prerelease: true | ||
draft: false | ||
commit: ${{ github.sha }} | ||
tag: ${{ steps.semver.outputs.next }} | ||
name: ${{ steps.semver.outputs.next }} | ||
body: '*pending*' | ||
token: ${{ github.token }} | ||
|
||
- name: Update CHANGELOG | ||
id: changelog | ||
if: ${{ !env.ACT }} | ||
uses: requarks/changelog-action@v1 | ||
with: | ||
token: ${{ github.token }} | ||
tag: ${{ github.ref_name }} | ||
|
||
- name: Create Release | ||
if: ${{ !env.ACT }} | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "rf-liquidsoap*.tar.gz" | ||
allowUpdates: true | ||
draft: false | ||
makeLatest: true | ||
tag: ${{ steps.semver.outputs.next }} | ||
name: ${{ steps.semver.outputs.next }} | ||
body: ${{ steps.changelog.outputs.changes }} | ||
token: ${{ github.token }} | ||
|
||
- name: Commit CHANGELOG.md | ||
if: ${{ !env.ACT }} | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
branch: main | ||
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]' | ||
file_pattern: CHANGELOG.md |