-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joy
committed
Aug 16, 2022
1 parent
8f18130
commit 73651ae
Showing
2 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: build releases | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_win: | ||
name: Build (Windows) | ||
runs-on: windows-latest | ||
|
||
if: github.event.release.tag_name | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
pwd | ||
git clone --depth 1 ${{ secrets.REPO1_URL }} | ||
cd ${{ secrets.REPO1_NAME }} | ||
npm install -g electron-builder@21.2.0 | ||
npm install -g cross-env | ||
npm config set electron_mirror https://github.com/WestBerryVIA/electron-archive/releases/download/ | ||
npm run dist | ||
- name: read version | ||
id: version | ||
uses: ashley-taylor/read-json-property-action@v1.0 | ||
with: | ||
path: ${{ secrets.REPO1_NAME }}/package.json | ||
property: version | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: VIA-${{steps.version.outputs.value}}-win.zip | ||
path: ${{ secrets.REPO1_NAME }}/build/VIA-${{steps.version.outputs.value}}-win.zip | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: VIA Setup ${{steps.version.outputs.value}}.exe | ||
path: ${{ secrets.REPO1_NAME }}/build/VIA Setup ${{steps.version.outputs.value}}.exe | ||
|
||
build_macos: | ||
name: Build (macOS) | ||
runs-on: macOS-latest | ||
|
||
if: github.event.release.tag_name | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
pwd | ||
git clone --depth 1 ${{ secrets.REPO1_URL }} | ||
cd ${{ secrets.REPO1_NAME }} | ||
npm install -g electron-builder@21.2.0 | ||
npm install -g cross-env | ||
npm config set electron_mirror https://github.com/WestBerryVIA/electron-archive/releases/download/ | ||
npm run dist | ||
- name: read version | ||
id: version | ||
uses: ashley-taylor/read-json-property-action@v1.0 | ||
with: | ||
path: ${{ secrets.REPO1_NAME }}/package.json | ||
property: version | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: VIA-${{steps.version.outputs.value}}-mac.zip | ||
path: ${{ secrets.REPO1_NAME }}/build/VIA-${{steps.version.outputs.value}}-mac.zip | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: VIA-${{steps.version.outputs.value}}.dmg | ||
path: ${{ secrets.REPO1_NAME }}/build/VIA-${{steps.version.outputs.value}}.dmg | ||
|
||
publish_release: | ||
name: Publish (Release) | ||
runs-on: ubuntu-latest | ||
|
||
needs: [build_macos, build_win] | ||
|
||
if: github.event.release.tag_name | ||
|
||
steps: | ||
- uses: actions/download-artifact@v3 | ||
|
||
- uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
name: ${{ github.event.release.name }} | ||
files: | | ||
./VIA Setup ${{ github.event.release.tag_name }}.exe/VIA Setup ${{ github.event.release.tag_name }}.exe | ||
./VIA-${{ github.event.release.tag_name }}-win.zip/VIA-${{ github.event.release.tag_name }}-win.zip | ||
./VIA-${{ github.event.release.tag_name }}.dmg/VIA-${{ github.event.release.tag_name }}.dmg | ||
./VIA-${{ github.event.release.tag_name }}-mac.zip/VIA-${{ github.event.release.tag_name }}-mac.zip |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: releases-app | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest] | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2.4.2 | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v3.4.1 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: Update repo | ||
run: | | ||
git clone ${{ secrets.REPO_URL }} | ||
mv -f ${{ secrets.REPO_NAME }}/* . | ||
- name: Build/release Electron app | ||
uses: samuelmeuli/action-electron-builder@v1.6.0 | ||
with: | ||
github_token: ${{ secrets.CI_PAT }} | ||
release: true | ||
|
||
release-windows: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2.4.2 | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v3.4.1 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: Update repo | ||
run: | | ||
git clone ${{ secrets.REPO_URL }} | ||
Remove-Item -Recurse -Force ./${{ secrets.REPO_NAME }}/.git | ||
Move-Item -Force ${{ secrets.REPO_NAME }}/* . | ||
- name: Build/release Electron app | ||
uses: samuelmeuli/action-electron-builder@v1.6.0 | ||
with: | ||
github_token: ${{ secrets.CI_PAT }} | ||
release: true |