Prepare release #678
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: Prepare release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
release: | |
name: Check for new features to be released | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/master' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Changes since last tag | |
id: diff | |
run: | | |
LAST_TAG="$(git describe --tags --abbrev=0)" | |
CURRENT_TAG="${{ github.ref }}" | |
CHANGES="$(git diff $LAST_TAG $CURRENT_TAG --stat)" | |
ANY_CHANGES='false' | |
if [[ "$CHANGES" != "" ]]; then | |
ANY_CHANGES='true' | |
fi | |
echo "last-tag=$LAST_TAG" >> $GITHUB_OUTPUT | |
echo "any_changes=$ANY_CHANGES" >> $GITHUB_OUTPUT | |
echo "from: $LAST_TAG" | |
echo "to: $CURRENT_TAG" | |
echo "changes: $ANY_CHANGES" | |
- name: Setup Node.js | |
if: ${{ steps.diff.outputs.any_changes == 'true' }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
- name: Bump | |
if: ${{ steps.diff.outputs.any_changes == 'true' }} | |
id: version-bump | |
uses: phips28/gh-action-bump-version@master | |
with: | |
tag-prefix: v | |
env: | |
GITHUB_TOKEN: ${{ secrets.NRCHKB_DOCKER }} | |
- name: Checkout | |
if: ${{ steps.diff.outputs.any_changes == 'true' }} | |
uses: actions/checkout@v4 | |
- name: Create release | |
if: ${{ steps.diff.outputs.any_changes == 'true' }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.version-bump.outputs.newTag }} | |
- name: Dispatch release build | |
if: ${{ steps.diff.outputs.any_changes == 'true' }} | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.NRCHKB_DOCKER }} | |
event-type: docker-build |