diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..bbcf9e7 --- /dev/null +++ b/.github/workflows/main.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/releases-app.yml b/.github/workflows/releases-app.yml new file mode 100644 index 0000000..d78106b --- /dev/null +++ b/.github/workflows/releases-app.yml @@ -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 \ No newline at end of file