From f7c862aeddda2377831817f9d925619ab411c4b9 Mon Sep 17 00:00:00 2001 From: NAmorim Date: Tue, 2 Nov 2021 11:51:18 +0000 Subject: [PATCH] Update github release workflow --- .github/workflows/release_build.yml | 51 +++++++++++++++++++------ .github/workflows/release_build_dev.yml | 2 - 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index e448ed7e53..fbb2ef9e02 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -1,40 +1,69 @@ name: Build/release Binaries on: - push: + pull_request: branches: [master] - tags: - - '*' - release: - types: [published, created, edited] + #release: + # types: [published, created] workflow_dispatch: jobs: - release: - runs-on: ${{ matrix.os }} + create-release: + runs-on: ubuntu-latest + steps: + - name: Download a file + run: curl "https://raw.githubusercontent.com/${{ github.repository }}/master/package.json" -o package.json + + - name: get-version + id: version + uses: nyaa8/package-version@v1 + with: + path: './package.json' + + - name: Create release + id: create_release + uses: viperproject/create-nightly-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.PACKAGE_VERSION }} + release_name: Superalgos-v${{ env.PACKAGE_VERSION }} + build-release: + runs-on: ${{ matrix.os }} + needs: create-release strategy: - matrix: - os: [windows-latest, macos-latest] + matrix: + os: [windows-latest, macos-latest] steps: - name: Check out Git repository uses: actions/checkout@v2 + with: + ref: develop - name: Install Node.js, NPM and Yarn uses: actions/setup-node@v1 with: node-version: 14 + - name: get-version + id: version + uses: nyaa8/package-version@v1 + with: + path: './package.json' + - name: Build/release Electron app uses: samuelmeuli/action-electron-builder@v1 with: # GitHub token, automatically provided to the action # (No need to define this secret in the repo settings) github_token: ${{ secrets.github_token }} - args: "-c.extraMetadata.main=electron-wrapper.js -c build/electron-builder.json" + args: "-c.extraMetadata.version=${{ env.PACKAGE_VERSION }} -c build/electron-builder.json -p always" # If the commit is tagged with a version (e.g. "v1.0.0"), # release the app after building - release: ${{ startsWith(github.ref, 'refs/tags/') }} + # release: ${{ startsWith(github.ref, 'refs/tags/v') }} + release: true + diff --git a/.github/workflows/release_build_dev.yml b/.github/workflows/release_build_dev.yml index feb7d2a589..a0784fb09e 100644 --- a/.github/workflows/release_build_dev.yml +++ b/.github/workflows/release_build_dev.yml @@ -63,8 +63,6 @@ jobs: path: './package.json' - name: Build/release Electron app - #env: - # DATE: ${{ steps.date.outputs.date }} uses: samuelmeuli/action-electron-builder@v1 with: # GitHub token, automatically provided to the action