Skip to content

assets-build

assets-build #42

Workflow file for this run

name: Assets build
on:
# The `release: create` event (nor-any other release type events) are not triggered for release draft creation
# which is needed to have all the assets build when the release goes out.
# We hence uses `repository_dispatch` from the `release.yaml` workflow when release is created by the release-please mechanism.
repository_dispatch:
types: [assets-build]
jobs:
publish-macos-m1:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: 18
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install setuptools
run: python3 -m pip install setuptools
- name: Install all dependencies
run: npm ci && cd ./ui && npm ci
- name: Set MacOS signing certs
run: .github/tools/add-macos-cert.sh
env:
MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}
- name: Build
run: npm run build
- name: Copy dashboard lib
run: cp ./ui/node_modules/@ethersphere/bee-dashboard/lib/* ./dist/ui/static/js
continue-on-error: true
- name: Purge ui src
run: npx rimraf ./ui
- name: Publish MacOS arm64
run: npm run publish:mac:arm64
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-macos-x64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: 18
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install setuptools
run: python3 -m pip install setuptools
- name: Install all dependencies
run: npm ci && cd ./ui && npm ci
- name: Set MacOS signing certs
run: .github/tools/add-macos-cert.sh
env:
MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}
- name: Build
run: npm run build
- name: Copy dashboard lib
run: cp ./ui/node_modules/@ethersphere/bee-dashboard/lib/* ./dist/ui/static/js
continue-on-error: true
- name: Purge ui src
run: npx rimraf ./ui
- name: Publish MacOS x64
run: npm run publish:mac:x64
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: 18
- uses: actions/setup-python@v4
if: matrix.os == 'macos-latest'
with:
python-version: '3.12'
- name: Install setuptools
if: matrix.os == 'macos-latest'
run: python3 -m pip install setuptools
- name: Install dependencies
run: npm ci && cd ./ui && npm ci
- name: Set MacOS signing certs
if: matrix.os == 'macos-latest'
run: .github/tools/add-macos-cert.sh
env:
MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}
- name: Set Windows signing certificate
if: matrix.os == 'windows-latest'
continue-on-error: true
id: write_file
uses: timheuer/base64-to-file@v1
with:
fileName: 'win-certificate.pfx'
encodedString: ${{ secrets.WINDOWS_CODESIGN_P12 }}
- name: Build
run: npm run build
- name: Copy dashboard lib
run: cp ./ui/node_modules/@ethersphere/bee-dashboard/lib/* ./dist/ui/static/js
continue-on-error: true
- name: Purge ui src
run: npx rimraf ./ui
- name: Publish
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WINDOWS_CODESIGN_FILE: ${{ steps.write_file.outputs.filePath }}
WINDOWS_CODESIGN_PASSWORD: ${{ secrets.WINDOWS_CODESIGN_PASSWORD }}
run: npm run publish
- name: Publish Linux arm64
if: matrix.os == 'ubuntu-latest'
run: npm run publish:linux:arm64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}