Skip to content

Commit

Permalink
ci: add github worflow for creating a release release
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilbert MINH committed Apr 19, 2024
1 parent fb3f640 commit e114fd6
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit e114fd6

Please sign in to comment.