fix version #51
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: Build and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Extract version from tag | |
| id: get_version | |
| shell: bash | |
| run: | | |
| TAG=${GITHUB_REF#refs/tags/v} | |
| echo "VERSION=$TAG" >> $GITHUB_OUTPUT | |
| echo "Extracted version: $TAG" | |
| - name: Update package.json version | |
| shell: bash | |
| run: | | |
| VERSION=${{ steps.get_version.outputs.VERSION }} | |
| echo "Updating package.json version to $VERSION" | |
| if [[ "$RUNNER_OS" == "Windows" ]]; then | |
| npx json -I -f package.json -e "this.version=\"$VERSION\"" | |
| else | |
| sed -i.bak "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" package.json | |
| rm -f package.json.bak | |
| fi | |
| cat package.json | grep version | |
| - name: Build Electron app (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: npm run electron:build:linux | |
| - name: Build Electron app (macOS) | |
| if: matrix.os == 'macos-latest' | |
| run: npm run electron:build:mac | |
| - name: Build Electron app (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: npm run electron:build:win | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.os }}-build | |
| path: | | |
| release/*.exe | |
| release/*.exe.blockmap | |
| release/*.dmg | |
| release/*.dmg.blockmap | |
| release/*.AppImage | |
| release/latest*.yml | |
| if-no-files-found: ignore | |
| publish: | |
| needs: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: artifacts/*/** | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |