packagejson #6
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: | |
- master | |
jobs: | |
release: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
- name: Get package version | |
id: version | |
run: echo "::set-output name=version::$(node -p "require('./package.json').version")" | |
- name: Install dependencies | |
run: | | |
npm install | |
npm install -g electron-packager | |
- name: Build Electron app | |
run: npm run build | |
- name: Zip the app | |
run: Compress-Archive -Path build/Haino-win32-x64 -DestinationPath build/Haino-win32-x64.zip -Force | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
build/Haino-win32-x64.zip | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: v${{ github.ref }} | |
name: Release v${{ steps.version.outputs.version }} | |
- name: Push changes | |
uses: ad-m/github-push-action@v0.7.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |