Track Variable (Re-)Definitions (#386) #58
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': | |
push: | |
branches: | |
- main | |
jobs: | |
full-test: | |
name: "Run Full Test Suite (Release)" | |
if: startsWith(github.event.head_commit.message, '[release:minor]') || | |
startsWith(github.event.head_commit.message, '[release:major]') || | |
startsWith(github.event.head_commit.message, '[release:patch]') | |
uses: Code-Inspect/flowr/.github/workflows/full-test.yaml@main | |
release: | |
name: "Release" | |
runs-on: ubuntu-latest | |
needs: ['full-test'] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.RELEASE_TOKEN }} | |
- name: Name and Email for Git (config) | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- name: Install Dependencies | |
run: npm ci | |
- name: Release | |
run: | | |
msg="${{ github.event.head_commit.message }}" | |
step=$(echo "$msg" | sed -n -E 's/\[release:(patch|minor|major)].*/\1/p') | |
title=$(echo "$msg" | sed -n -E 's/\[release:(patch|minor|major)] (.*)/\2/p') | |
if [ -z "$step" ]; then | |
echo "fatal: Release step not found in commit message." | |
exit 1 | |
fi | |
npm run release -- $step --github.releaseName="Release v\${version} (${title})" | |
env: | |
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
performance-test: | |
name: "Performance Test" | |
needs: ['release'] | |
# we do not run if the release workflow runs it with pushing | |
if: startsWith(github.event.head_commit.message, '[release:minor]') || | |
startsWith(github.event.head_commit.message, '[release:major]') || | |
startsWith(github.event.head_commit.message, '[release:patch]') | |
uses: Code-Inspect/flowr/.github/workflows/performance-test.yaml@main | |
with: | |
push: true | |
secrets: inherit | |
deploy-docker: | |
needs: ['performance-test'] | |
name: "Deploy Docker (only on main)" | |
uses: Code-Inspect/flowr/.github/workflows/deploy-docker.yaml@main | |
secrets: inherit |