Release #71
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: Release | |
on: | |
workflow_run: | |
workflows: ["Build and test"] | |
branches: [main] | |
types: | |
- completed | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Bump version and push tag | |
uses: anothrNick/[email protected] | |
id: version | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
DEFAULT_BUMP: patch | |
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} | |
- name: Major version tag | |
id: major-version | |
if: ${{ steps.version.outputs.new_tag }} != "" | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
core.setOutput('tag', '${{ steps.version.outputs.new_tag }}'.split('.')[0]) | |
- name: Tag ${{ steps.major-version.outputs.tag }} | |
if: ${{ steps.version.outputs.new_tag }} != "" | |
run: | | |
git tag --force ${{ steps.major-version.outputs.tag }} | |
git push origin ${{ steps.major-version.outputs.tag }} --force | |
- name: Get current date | |
if: ${{ steps.version.outputs.new_tag }} != "" | |
id: date | |
run: echo "::set-output name=date::$(date --iso-8601)" | |
- name: Get shoutrrr version | |
if: ${{ steps.version.outputs.new_tag }} != "" | |
id: shoutrrr | |
run: echo "::set-output name=version::$(docker run --rm $(docker build --quiet - < Dockerfile) --version)" | |
- name: Build full ChangeLog | |
if: ${{ steps.version.outputs.new_tag }} != '' | |
run: npx conventional-changelog-cli --release-count=0 --preset=eslint --outfile="${{ runner.temp }}/FullChangeLog.md" | |
- name: Create/update release ${{ steps.major-version.outputs.tag }} | |
if: ${{ steps.version.outputs.new_tag }} != "" | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
allowUpdates: true | |
tag: ${{ steps.major-version.outputs.tag }} | |
name: ${{ steps.version.outputs.new_tag }} (${{ steps.date.outputs.date }} / ${{ steps.shoutrrr.outputs.version }}) | |
bodyFile: ${{ runner.temp }}/FullChangeLog.md | |
- name: Build ChangeLog | |
if: ${{ steps.version.outputs.new_tag }} != '' | |
run: npx conventional-changelog-cli --release-count=2 --outfile="${{ runner.temp }}/ChangeLog.md" | |
- name: Create release ${{ steps.version.outputs.new_tag }} | |
if: ${{ steps.version.outputs.new_tag }} != "" | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.version.outputs.new_tag }} | |
name: ${{ steps.version.outputs.new_tag }} (${{ steps.shoutrrr.outputs.version }}) | |
bodyFile: ${{ runner.temp }}/ChangeLog.md |