Game Socket and Service #69
Workflow file for this run
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
name: Build | |
on: | |
# Allow developers to run this on-demand. | |
workflow_dispatch: | |
# Allow the release workflow to trigger this workflow. | |
workflow_call: | |
# Validate pull request to confirm that the build is still working. | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
# Allow at most one instance of this workflow to run at a time. | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
GIT_USER_NAME: github-actions[bot] | |
GIT_USER_EMAIL: github-actions[bot]@users.noreply.github.com | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
cache: yarn | |
cache-dependency-path: yarn.lock | |
- name: Create .env file from GitHub Secrets | |
shell: bash | |
env: | |
SENTRY_INGEST_DOMAIN: ${{ secrets.SENTRY_INGEST_DOMAIN }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
SENTRY_ORG: ${{ github.repository_owner }} | |
SENTRY_PROJECT: ${{ github.event.repository.name }} | |
run: | | |
echo "" > .env | |
echo "APP_ENV=production" >> .env | |
echo "LOG_LEVEL=info" >> .env | |
echo "SENTRY_INGEST_DOMAIN=${SENTRY_INGEST_DOMAIN}" >> .env | |
echo "SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}" >> .env | |
echo "SENTRY_DSN=${SENTRY_DSN}" >> .env | |
echo "SENTRY_ORG=${SENTRY_ORG}" >> .env | |
echo "SENTRY_PROJECT=${SENTRY_PROJECT}" >> .env | |
# https://docs.sentry.io/platforms/javascript/guides/electron/configuration/tree-shaking/ | |
echo "__SENTRY_DEBUG__=false" >> .env | |
echo "__SENTRY_TRACING__=false" >> .env | |
- name: Install dependencies | |
shell: bash | |
run: yarn install | |
- name: Build Linux | |
shell: bash | |
if: matrix.os == 'ubuntu-latest' | |
run: yarn build:linux | |
- name: Build MacOS | |
shell: bash | |
if: matrix.os == 'macos-latest' | |
run: yarn build:mac && yarn sentry:sourcemaps | |
- name: Build Windows | |
shell: bash | |
if: matrix.os == 'windows-latest' | |
run: yarn build:win | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: phoenix-app-${{ matrix.os }} | |
path: | | |
dist/phoenix-*.snap | |
dist/phoenix-*.deb | |
dist/phoenix-*.exe | |
dist/phoenix-*.dmg | |
dist/phoenix-*.zip | |
retention-days: 5 |