Merge pull request #1385 from emeraldpay/feature/always-allow-lower-fee #936
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: Builds | |
on: | |
push: | |
branches: | |
- master | |
- ci/* | |
- release/* | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ['windows-latest', 'macos-latest', 'ubuntu-latest'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Auth GCP | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: ${{ secrets.GCP_ARTIFACTS_KEY }} | |
# on Windows GCP Actions needs path to Python, see https://github.com/GoogleCloudPlatform/github-actions/issues/100 | |
- name: Setup GCP (Windows) | |
uses: google-github-actions/setup-gcloud@v1 | |
env: | |
CLOUDSDK_PYTHON: ${{env.pythonLocation}}\python.exe | |
with: | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
if: runner.os == 'Windows' | |
- name: Setup GCP (non Windows) | |
uses: google-github-actions/setup-gcloud@v1 | |
with: | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
if: runner.os != 'Windows' | |
- name: Update apt index (Linux) | |
run: sudo apt update | |
if: runner.os == 'Linux' | |
- name: Install system libs (Linux) | |
run: sudo apt install libcurl4 libudev-dev libusb-1.0-0-dev xvfb | |
if: runner.os == 'Linux' | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Install dependencies | |
run: yarn install | |
- name: Get commit data (Windows) | |
id: commit-data-windows | |
run: | | |
echo "commit-date=$(git show -s --format=%cs ${{ github.sha }})" >> $env:GITHUB_OUTPUT | |
echo "short-sha=$(git rev-parse --short ${{ github.sha }})" >> $env:GITHUB_OUTPUT | |
if: runner.os == 'Windows' | |
- name: Get commit data (non Windows) | |
id: commit-data-non-windows | |
run: | | |
echo "commit-date=$(git show -s --format=%cs ${{ github.sha }})" >> "$GITHUB_OUTPUT" | |
echo "short-sha=$(git rev-parse --short ${{ github.sha }})" >> "$GITHUB_OUTPUT" | |
if: runner.os != 'Windows' | |
- name: Write commit data (Windows) | |
run: | | |
echo '{' > packages/desktop/commit-data.json | |
echo ' "commitDate": "${{ steps.commit-data-windows.outputs.commit-date }}",' >> packages/desktop/commit-data.json | |
echo ' "shortSha": "${{ steps.commit-data-windows.outputs.short-sha }}"' >> packages/desktop/commit-data.json | |
echo '}' >> packages/desktop/commit-data.json | |
if: runner.os == 'Windows' | |
- name: Write commit data (non Windows) | |
run: | | |
echo '{' > packages/desktop/commit-data.json | |
echo ' "commitDate": "${{ steps.commit-data-non-windows.outputs.commit-date }}",' >> packages/desktop/commit-data.json | |
echo ' "shortSha": "${{ steps.commit-data-non-windows.outputs.short-sha }}"' >> packages/desktop/commit-data.json | |
echo '}' >> packages/desktop/commit-data.json | |
if: runner.os != 'Windows' | |
- name: Get package data (Windows) | |
id: package-data-windows | |
run: echo "version=$(jq -r '.version' packages/desktop/package.json)" >> $env:GITHUB_OUTPUT | |
if: runner.os == 'Windows' | |
- name: Get package data (non Windows) | |
id: package-data-non-windows | |
run: echo "version=$(jq -r '.version' packages/desktop/package.json)" >> "$GITHUB_OUTPUT" | |
if: runner.os != 'Windows' | |
- name: Build (Windows) | |
run: yarn build:dist | |
env: | |
APP_VERSION_GIT_TAG: '${{ steps.package-data-windows.outputs.version }}-${{ steps.commit-data-windows.outputs.commit-date }}-${{ steps.commit-data-windows.outputs.short-sha }}' | |
if: runner.os == 'Windows' | |
- name: Build (non Windows) | |
run: yarn build:dist | |
env: | |
APP_VERSION_GIT_TAG: '${{ steps.package-data-non-windows.outputs.version }}-${{ steps.commit-data-non-windows.outputs.commit-date }}-${{ steps.commit-data-non-windows.outputs.short-sha }}' | |
if: runner.os != 'Windows' | |
# on Windows GCP Actions needs path to Python, see https://github.com/GoogleCloudPlatform/github-actions/issues/100 | |
- name: Upload to GCP (Windows) | |
run: gsutil cp -n packages/desktop/dist/EmeraldWallet-*.exe gs://artifacts.emerald.cash/builds/emerald-wallet/v${{ steps.package-data-windows.outputs.version }}/ | |
if: runner.os == 'Windows' | |
env: | |
CLOUDSDK_PYTHON: ${{env.pythonLocation}}\python.exe | |
- name: Upload to GCP (non Windows) | |
run: gsutil cp -n packages/desktop/dist/EmeraldWallet-*.* gs://artifacts.emerald.cash/builds/emerald-wallet/v${{ steps.package-data-non-windows.outputs.version }}/ | |
if: runner.os != 'Windows' | |
- name: Link to published artifact (Windows) | |
if: runner.os == 'Windows' | |
run: echo "https://artifacts.emerald.cash/builds/emerald-wallet/v${{ steps.package-data-windows.outputs.version }}/EmeraldWallet-win-x64-${{ steps.package-data-windows.outputs.version }}-${{ steps.commit-data-windows.outputs.commit-date }}-${{ steps.commit-data-windows.outputs.short-sha }}.exe" | |
- name: Link to published artifact (macOS) | |
if: runner.os == 'macOS' | |
run: echo "https://artifacts.emerald.cash/builds/emerald-wallet/v${{ steps.package-data-non-windows.outputs.version }}/EmeraldWallet-mac-x64-${{ steps.package-data-non-windows.outputs.version }}-${{ steps.commit-data-non-windows.outputs.commit-date }}-${{ steps.commit-data-non-windows.outputs.short-sha }}.dmg" | |
- name: Link to published artifact (Linux) | |
if: runner.os == 'Linux' | |
run: echo "https://artifacts.emerald.cash/builds/emerald-wallet/v${{ steps.package-data-non-windows.outputs.version }}/EmeraldWallet-linux-amd64-${{ steps.package-data-non-windows.outputs.version }}-${{ steps.commit-data-non-windows.outputs.commit-date }}-${{ steps.commit-data-non-windows.outputs.short-sha }}.deb" | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: | | |
packages/desktop/dist/*.zip | |
packages/desktop/dist/*.dmg | |
packages/desktop/dist/*.exe | |
packages/desktop/dist/*.deb | |
packages/desktop/dist/*.tar.gz | |
packages/desktop/dist/*.AppImage |