chore: add node-fetch dependency and update download links #17
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: | |
- 'releases/*' | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: macos-14 | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- run: | | |
git config user.name "GitHub Actions" | |
git config user.email "[email protected]" | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- run: | | |
npm install -g pnpm | |
pnpm install | |
- run: | | |
node docs/software_lists.mjs | |
git add README.md | |
git diff --cached --quiet || (git commit -m "docs: update software lists" && git push origin ${{ github.ref }}) | |
env: | |
CI: true | |
- uses: technote-space/toc-generator@v4 | |
with: | |
FOLDING: 'true' | |
- uses: TriPSs/conventional-changelog-action@v5 | |
id: changelog | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
release-count: 0 | |
skip-git-pull: 'true' | |
- run: | | |
export APP_VERSION=$(node -p "require('./package.json').version") | |
npm run production | |
- run: ls ./dist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: ./dist | |
- uses: ncipollo/release-action@v1 | |
id: release | |
if: steps.changelog.outputs.skipped != 'true' | |
with: | |
allowUpdates: true | |
artifacts: 'dist/env-setup-*' | |
body: ${{ steps.changelog.outputs.clean_changelog }} | |
draft: false | |
generateReleaseNotes: true | |
name: ${{ steps.changelog.outputs.tag }} | |
prerelease: false | |
tag: ${{ steps.changelog.outputs.tag }} | |
token: ${{ secrets.PAT }} | |
- name: Update download links | |
if: steps.release.outputs.id != '' | |
run: | | |
node docs/download_links.mjs | |
git add README.md | |
git diff --cached --quiet || (git commit -m "docs: update download links" && git push origin ${{ github.ref }}) | |
- name: Merge release branch | |
if: steps.release.outputs.id != '' | |
run: | | |
git checkout main | |
git pull | |
git merge --no-ff ${{ steps.changelog.outputs.tag }} | |
git push |