Skip to content

Commit c092f65

Browse files
committed
up7
1 parent 9c24443 commit c092f65

File tree

1 file changed

+13
-31
lines changed

1 file changed

+13
-31
lines changed

.github/workflows/build-test.yml

+13-31
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,21 @@ jobs:
1010
os: [macos-latest, windows-latest]
1111

1212
steps:
13-
- name: Checkout code
13+
- name: Check out Git repository
1414
uses: actions/checkout@v2
1515

16-
- name: Install dependencies
17-
run: npm install
18-
19-
- name: Build project
20-
run: npm run build
21-
22-
- name: Get version from package.json
23-
id: get_version
24-
run: |
25-
$json = Get-Content ./package.json -Raw | ConvertFrom-Json
26-
echo "::set-output name=version::$json.version"
27-
28-
- name: Create Release
29-
id: create_release
30-
uses: actions/create-release@v1
16+
- name: Install Node.js, NPM and Yarn
17+
uses: actions/setup-node@v1
3118
with:
32-
tag_name: v${{ steps.get_version.outputs.version }}
33-
release_name: Release v${{ steps.get_version.outputs.version }}
34-
draft: false
35-
prerelease: false
36-
env:
37-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
19+
node-version: 16
3820

39-
- name: Upload Release Asset
40-
id: upload-release-asset
41-
uses: actions/upload-release-asset@v1
21+
- name: Build/release Electron app
22+
uses: samuelmeuli/action-electron-builder@v1
4223
with:
43-
upload_url: ${{ steps.create_release.outputs.upload_url }}
44-
asset_path: '${{ github.workspace }}/release/dilidili.zip'
45-
asset_name: 'dilidili-${{ steps.get_version.outputs.version }}-${{ runner.os }}.zip'
46-
asset_content_type: application/zip
47-
env:
48-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
24+
# GitHub token, automatically provided to the action
25+
# (No need to define this secret in the repo settings)
26+
github_token: ${{ secrets.GH_TOKEN }}
27+
28+
# If the commit is tagged with a version (e.g. "v1.0.0"),
29+
# release the app after building
30+
release: ${{ startsWith(github.ref, 'refs/tags/v') }}

0 commit comments

Comments
 (0)