build(deps): bump got, electron-builder and git-authors-cli in /build_scripts/npm_macos #135
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 & Release | |
on: | |
push: | |
tags: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
concurrency: | |
# SHA is added to the end if on `main` to let all main workflows run | |
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }} | |
cancel-in-progress: true | |
jobs: | |
build_mac: | |
name: Build Mac Installer | |
runs-on: macos-latest | |
steps: | |
- uses: Chia-Network/actions/clean-workspace@main | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Setup Node 18.16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.16' | |
- name: install dmg-license | |
run: npm i dmg-license | |
- name: npm install | |
run: | | |
node --version | |
npm install | |
- name: Import Apple installer signing certificate | |
uses: Apple-Actions/import-codesign-certs@v1 | |
with: | |
p12-file-base64: ${{ secrets.APPLE_DEV_ID_APP }} | |
p12-password: ${{ secrets.APPLE_DEV_ID_APP_PASS }} | |
- name: Build electron app | |
env: | |
CSC_FOR_PULL_REQUEST: "true" | |
run: npm run electron:package:mac | |
- name: Notarize | |
run: | | |
DMG_FILE=$(find ${{ github.workspace }}/dist/ -type f -name '*.dmg') | |
npm install -g notarize-cli | |
notarize-cli \ | |
--file="$DMG_FILE" \ | |
--bundle-id net.chia.climate-explorer-ui \ | |
--username "${{ secrets.APPLE_NOTARIZE_USERNAME }}" \ | |
--password "${{ secrets.APPLE_NOTARIZE_PASSWORD }}" | |
- name: Upload Mac Installer | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mac-installer | |
path: ${{ github.workspace }}/dist/*.dmg | |
build_windows: | |
name: Build Windows Installer | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Setup Node 18.16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.16' | |
- name: npm install | |
run: | | |
node --version | |
npm install | |
- name: Build electron app | |
env: | |
CSC_LINK: ${{ secrets.WIN_CODE_SIGN_CERT }} | |
CSC_KEY_PASSWORD: ${{ secrets.WIN_CODE_SIGN_PASSWORD }} | |
run: npm run electron:package:win | |
- name: Upload Windows Installer | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-installer | |
path: ${{ github.workspace }}/dist/*.exe | |
build_linux: | |
name: Build Linux Installer | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Setup Node 18.16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.16' | |
- name: npm install | |
run: | | |
node --version | |
npm install | |
- name: Build electron app | |
run: npm run electron:package:linux | |
- name: Upload Linux Installer | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-installer | |
path: ${{ github.workspace }}/dist/*.deb | |
build_web: | |
name: Build Web App | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Setup Node 18.16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.16' | |
- name: Install Husky | |
run: npm install --save-dev husky | |
- name: npm install and build | |
run: | | |
node --version | |
npm install | |
npm run build | |
- name: Create .tar.gz of the web build | |
run: tar -cvzf climate-explorer-ui-web-build.tar.gz build | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: climate-explorer-ui-web-build | |
path: climate-explorer-ui-web-build.tar.gz | |
release: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- build_mac | |
- build_windows | |
- build_linux | |
steps: | |
- name: Download Windows artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: windows-installer | |
path: windows-installer | |
- name: Download MacOS artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: mac-installer | |
path: mac-installer | |
- name: Download Linux artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: linux-installer | |
path: linux-installer | |
- name: Download Web artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: climate-explorer-ui-web-build | |
path: climate-explorer-ui-web-build | |
- name: Get Filenames | |
run: | | |
DMG_FILE=$(find ${{ github.workspace }}/mac-installer/ -type f -name '*.dmg') | |
DEB_FILE=$(find ${{ github.workspace }}/linux-installer/ -type f -name '*.deb') | |
EXE_FILE=$(find ${{ github.workspace }}/windows-installer/ -type f -name '*.exe') | |
WEB_FILE=$(find ${{ github.workspace }}/climate-explorer-ui-web-build/ -type f -name '*.tar.gz') | |
echo "DMG_FILE=$DMG_FILE" >>$GITHUB_ENV | |
echo "DEB_FILE=$DEB_FILE" >>$GITHUB_ENV | |
echo "EXE_FILE=$EXE_FILE" >>$GITHUB_ENV | |
echo "WEB_FILE=$WEB_FILE" >>$GITHUB_ENV | |
- name: Release | |
uses: softprops/[email protected] | |
with: | |
files: | | |
${{ env.DMG_FILE }} | |
${{ env.DEB_FILE }} | |
${{ env.EXE_FILE }} | |
${{ env.WEB_FILE }} | |
- name: Get repo name | |
id: repo-name | |
run: | | |
echo "REPO_NAME=$(echo "$GITHUB_REPOSITORY" | cut -d "/" -f 2)" >>$GITHUB_OUTPUT | |
- name: Get tag name | |
id: tag-name | |
run: | | |
echo "TAGNAME=$(echo $GITHUB_REF | cut -d / -f 3)" >>$GITHUB_OUTPUT | |
- name: Trigger apt repo update | |
run: | | |
curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"climate_tokenization_repo":"${{ steps.repo-name.outputs.REPO_NAME }}","application_name":"[\"climate-explorer-ui\"]","release_version":"${{ steps.tag-name.outputs.TAGNAME }}","add_debian_version":"false","arm64":"false"}' ${{ secrets.GLUE_API_URL }}/api/v1/climate-tokenization/${{ github.sha }}/start | |
curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"climate_tokenization_repo":"${{ steps.repo-name.outputs.REPO_NAME }}","application_name":"[\"climate-explorer-ui\"]","release_version":"${{ steps.tag-name.outputs.TAGNAME }}","add_debian_version":"false","arm64":"false"}' ${{ secrets.GLUE_API_URL }}/api/v1/climate-tokenization/${{ github.sha }}/success/deploy |