Skip to content

Commit

Permalink
Added main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
wb-joy committed Aug 12, 2022
1 parent 8f18130 commit b43ae04
Showing 1 changed file with 105 additions and 0 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: build releases

on:
release:
types:
- published

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 https://${{ secrets.GIT_TOKEN }}@evove.top:6443/JoyLee/via-electron-wb.git
cd via-electron-wb/source
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: via-electron-wb/source/package.json
property: version

- uses: actions/upload-artifact@v3
with:
name: VIA-${{steps.version.outputs.value}}-win.zip
path: via-electron-wb/source/build/VIA-${{steps.version.outputs.value}}-win.zip

- uses: actions/upload-artifact@v3
with:
name: VIA Setup ${{steps.version.outputs.value}}.exe
path: via-electron-wb/source/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 https://${{ secrets.GIT_TOKEN }}@evove.top:6443/JoyLee/via-electron-wb.git
cd via-electron-wb/source
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: via-electron-wb/source/package.json
property: version

- uses: actions/upload-artifact@v3
with:
name: VIA-${{steps.version.outputs.value}}-mac.zip
path: via-electron-wb/source/build/VIA-${{steps.version.outputs.value}}-mac.zip

- uses: actions/upload-artifact@v3
with:
name: VIA-${{steps.version.outputs.value}}.dmg
path: via-electron-wb/source/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

0 comments on commit b43ae04

Please sign in to comment.