Skip to content

Release version v2.1.0 #8

Release version v2.1.0

Release version v2.1.0 #8

Workflow file for this run

name: publish
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
on-main-branch-check:
runs-on: ubuntu-latest
outputs:
on_main: ${{ steps.contains_tag.outputs.retval }}
steps:
# TODO: remove this and the `git branch -a` when the following PR
# is merged and released:
# https://github.com/rickstaa/action-contains-tag/pull/18
- name: git config --global remote.origin.followRemoteHEAD never
run: git config --global remote.origin.followRemoteHEAD never
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: rickstaa/action-contains-tag@v1
id: contains_tag
with:
reference: "main"
tag: "${{ github.ref_name }}"
test-docs:
name: test-docs
needs: on-main-branch-check
if: ${{ needs.on-main-branch-check.outputs.on_main == 'true' }}
uses: "./.github/workflows/test-docs.yml"
# FIXME: environment not being picked up in test-register action
# test-register:
# name: test-register
# needs: on-main-branch-check
# if: ${{ needs.on-main-branch-check.outputs.on_main == 'true' }}
# uses: "./.github/workflows/test-register.yml"
make-changelog:
runs-on: ubuntu-latest
needs:
- test-docs
# FIXME: add this back in when test-register is working
# - test-register
outputs:
release_body: ${{ steps.git-cliff.outputs.content }}
steps:
- name: Checkout the Repository at the Tagged Commit
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Generate a Changelog
uses: orhun/git-cliff-action@v3
id: git-cliff
with:
args: --latest --verbose
env:
GITHUB_REPO: ${{ github.repository }}
make-github-release:
runs-on: ubuntu-latest
environment: github
permissions:
contents: write
pull-requests: read
needs: make-changelog
steps:
- name: Checkout the Repository at the Tagged Commit
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
body: ${{ needs.make-changelog.outputs.release_body }}
draft: false
prerelease: false
- name: Update the latest tag
shell: bash
run: |
latest_tag=$(echo "${{ github.ref_name }}" | cut -c -2)
git config --global user.name "Github Actions"
git config --global user.email "[email protected]"
git tag -d "${latest_tag}" || echo ""
git tag -a -m "Release version ${{ github.ref_name }}" "${latest_tag}"
git push origin ":refs/tags/${latest_tag}" || echo ""
git push origin "${latest_tag}"