chore(build): update how use secrets in bash commands #27
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 | |
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 "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: Create .sentryclirc file for Sentry CLI | |
env: | |
SENTRY_ADMIN_TOKEN: ${{ secrets.SENTRY_ADMIN_TOKEN }} | |
run: | | |
echo "" > .sentryclirc | |
echo "[auth]" >> .sentryclirc | |
echo "token=${SENTRY_ADMIN_TOKEN}" >> .sentryclirc | |
- name: Install dependencies | |
run: yarn install | |
- name: Build Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: yarn build:linux | |
- name: Build MacOS | |
if: matrix.os == 'macos-latest' | |
run: yarn build:mac && yarn sentry:sourcemaps | |
- name: Build Windows | |
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 |