feat: CI/CD pipeline (build on push, release on tag) #1
Workflow file for this run
This file contains hidden or 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: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Verify package.json version matches tag | |
| shell: bash | |
| env: | |
| REF_NAME: ${{ github.ref_name }} | |
| run: | | |
| TAG_VERSION="${REF_NAME#v}" | |
| PKG_VERSION=$(node -p "require('./package.json').version") | |
| if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then | |
| echo "::error::package.json version ($PKG_VERSION) does not match tag ($TAG_VERSION)" | |
| exit 1 | |
| fi | |
| - run: npm ci | |
| - name: Build installer | |
| run: npm run build:installer | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build portable | |
| run: npm run build:portable | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| dist/*.exe | |
| dist/*.zip |