Skip to content

Commit

Permalink
chore: build binaries after tests are run on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilb committed Aug 7, 2023
1 parent 4b3c31d commit f55ec23
Showing 1 changed file with 57 additions and 3 deletions.
60 changes: 57 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
name: Session Test

on:
push:
branches:
- clearnet
- unstable
pull_request:
branches:
- clearnet
- unstable
- unstable1


concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -42,15 +46,15 @@ jobs:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}

#Not having this will break the windows build because the PATH won't be set by msbuild.
# Not having this will break the windows build because the PATH won't be set by msbuild.
- name: Add msbuild to PATH
uses: microsoft/[email protected]
if: runner.os == 'Windows'

- name: Setup node for windows
if: runner.os == 'Windows'
run: |
npm install --global node-gyp@latest
npm install --global yarn node-gyp@latest
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
Expand All @@ -66,3 +70,53 @@ jobs:

- name: Unit Test
run: yarn test

build-binaries:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2022, macos-11, ubuntu-20.04]
env:
SIGNAL_ENV: production
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build windows production binaries
if: runner.os == 'Windows'
run: node_modules\.bin\electron-builder --config.extraMetadata.environment=%SIGNAL_ENV% --publish=never --config.directories.output=release

- name: Build mac production binaries
if: runner.os == 'macOS'
run: |
source ./build/setup-mac-certificate.sh
$(yarn bin)/electron-builder --config.extraMetadata.environment=$SIGNAL_ENV --config.mac.bundleVersion=${{ github.ref }} --publish=never --config.directories.output=release
env:
MAC_CERTIFICATE: ${{ secrets.MAC_CERTIFICATE }}
MAC_CERTIFICATE_PASSWORD: ${{ secrets.MAC_CERTIFICATE_PASSWORD }}
SIGNING_APPLE_ID: ${{ secrets.SIGNING_APPLE_ID }}
SIGNING_APP_PASSWORD: ${{ secrets.SIGNING_APP_PASSWORD }}
SIGNING_TEAM_ID: ${{ secrets.SIGNING_TEAM_ID }}

- name: Build linux production binaries
if: runner.os == 'Linux'
run: |
sudo apt-get install -y rpm
yarn build-release
- name: Remove unpacked files
run: |
ls -d -- */ | xargs -I{} echo "Removing {}"
ls -d -- */ | xargs -I{} rm -rf {}
shell: bash
working-directory: ./release/

- name: Remaining files
run: ls .
shell: bash
working-directory: ./release/

- name: Upload Production Artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ runner.OS }}-production
path: release

0 comments on commit f55ec23

Please sign in to comment.