ci: switch to release-it #2
Workflow file for this run
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: Create Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
- 'v*.*.*-alpha.*' | |
- 'v*.*.*-beta.*' | |
jobs: | |
build: | |
uses: ./.github/workflows/build_rive_code_generator.yaml | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: rive_code_generator_macosx | |
- name: Determine release type | |
id: release_type | |
run: | | |
if [[ ${{ github.ref }} == *"-alpha"* ]]; then | |
echo "TYPE=Alpha" >> $GITHUB_OUTPUT | |
echo "IS_PRERELEASE=true" >> $GITHUB_OUTPUT | |
elif [[ ${{ github.ref }} == *"-beta"* ]]; then | |
echo "TYPE=Beta" >> $GITHUB_OUTPUT | |
echo "IS_PRERELEASE=true" >> $GITHUB_OUTPUT | |
else | |
echo "TYPE=Release" >> $GITHUB_OUTPUT | |
echo "IS_PRERELEASE=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Install release-it | |
run: npm install --global release-it @release-it/conventional-changelog | |
- name: Configure Git | |
run: | | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
- name: Generate Changelog | |
run: | | |
npx release-it --ci --dry-run --no-git.requireCleanWorkingDir --changelog | |
- name: Commit Changelog | |
run: | | |
git add CHANGELOG.md | |
git commit -m "Update CHANGELOG.md for ${{ github.ref_name }}" | |
git push origin HEAD:${{ github.ref }} | |
- name: Run release-it | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
release-it --ci \ | |
--github.release \ | |
--github.assets rive_code_generator_macosx \ | |
--no-git.requireCleanWorkingDir \ | |
--no-git.push \ | |
--no-npm.publish \ | |
--github.releaseName="${{ steps.release_type.outputs.TYPE }} ${GITHUB_REF#refs/tags/}" \ | |
--github.preRelease=${{ steps.release_type.outputs.IS_PRERELEASE }} \ | |
--plugins.@release-it/conventional-changelog \ | |
--no-increment |