Skip to content

Commit dc64482

Browse files
committed
fix: test upgraded snapcraft action
1 parent 587353c commit dc64482

File tree

1 file changed

+138
-0
lines changed

1 file changed

+138
-0
lines changed

.github/workflows/release-test.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Only run on master push
2+
name: Release Executables Binaries
3+
4+
on:
5+
push:
6+
branches:
7+
- fix/snapcraft-auth
8+
jobs:
9+
release:
10+
runs-on: ${{ matrix.os }}
11+
permissions:
12+
contents: write
13+
environment: deployment
14+
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest]
18+
19+
steps:
20+
- name: setup dependencies
21+
if: startsWith(matrix.os, 'ubuntu')
22+
run: sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libudev-dev libarchive-tools
23+
24+
- name: Check out Git repository
25+
uses: actions/checkout@v1
26+
27+
- name: Install Node.js, NPM and Yarn
28+
uses: actions/setup-node@v1
29+
with:
30+
node-version: 16
31+
32+
- name: Install deps with big timeout
33+
run: |
34+
yarn install --network-timeout 600000
35+
36+
- name: Install Snapcraft
37+
uses: samuelmeuli/action-snapcraft@v2
38+
# Only install Snapcraft on Ubuntu
39+
if: startsWith(matrix.os, 'ubuntu')
40+
with:
41+
# Log in to Snap Store
42+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
43+
44+
# - name: Install AzureSignTool
45+
# # Only install Azure Sign Tool on Windows
46+
# if: startsWith(matrix.os, 'windows')
47+
# run: dotnet tool install --global AzureSignTool
48+
49+
- name: Extract current branch name
50+
shell: bash
51+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
52+
id: extract_branch
53+
54+
- name: Get name & version from package.json
55+
shell: bash
56+
run: |
57+
echo "##[set-output name=name;]$(node -p -e '`${require("./package.json").name}`')"
58+
echo "##[set-output name=version;]$(node -p -e '`${require("./package.json").version}`')"
59+
id: package_json
60+
61+
- name: Log release reference
62+
run: |
63+
echo "********* START RELEASE REF **********"
64+
echo ${{ github.ref }}
65+
echo branch: ${{ steps.extract_branch.outputs.branch }}
66+
echo name: ${{ steps.package_json.outputs.name }}
67+
echo version: ${{ steps.package_json.outputs.version }}
68+
echo "********* END RELEASE REF ************"
69+
70+
- name: Prepare for app notarization (MacOS)
71+
if: startsWith(matrix.os, 'macos')
72+
# Import Apple API key for app notarization on macOS
73+
run: |
74+
mkdir -p ~/private_keys/
75+
echo '${{ secrets.mac_api_key }}' > ~/private_keys/AuthKey_${{ secrets.mac_api_key_id }}.p8
76+
77+
- name: Build/release Electron app (MacOS, Ubuntu, Windows)
78+
uses: samuelmeuli/action-electron-builder@v1
79+
# if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
80+
with:
81+
82+
build_script_name: electron:pre-build
83+
84+
# GitHub token, automatically provided to the action
85+
# (No need to define this secret in the repo settings)
86+
github_token: ${{ secrets.github_token }}
87+
88+
# When a push is done to master, the action builds binaries for all OS and they are then released directly
89+
release: ${{ steps.extract_branch.outputs.branch == 'master' }}
90+
91+
mac_certs: ${{ secrets.mac_certs }}
92+
mac_certs_password: ${{ secrets.mac_certs_password }}
93+
94+
env:
95+
# macOS notarization API key
96+
API_KEY_ID: ${{ secrets.mac_api_key_id }}
97+
API_KEY_ISSUER_ID: ${{ secrets.mac_api_key_issuer_id }}
98+
99+
# - name: Build Electron app (Windows)
100+
# if: startsWith(matrix.os, 'windows')
101+
# run: |
102+
# yarn run electron:build
103+
104+
# - name: Sign built binary (Windows)
105+
# if: startsWith(matrix.os, 'windows')
106+
# # Instead of pointing to a specific .exe, uses a PowerShell script which iterates through all the files stored in dist folder.
107+
# # If the file has the .exe extension, then it will use the AzureSignTool command to sign it.
108+
# run: |
109+
# cd dist; Get-ChildItem -recurse -Include **.exe | ForEach-Object {
110+
# $exePath = $_.FullName
111+
# & AzureSignTool sign -kvu "${{ secrets.azure_key_vault_url }}" -kvi "${{ secrets.azure_key_vault_client_id }}" -kvt "${{ secrets.azure_key_vault_tenant_id }}" -kvs "${{ secrets.azure_key_vault_client_secret }}" -kvc "${{ secrets.azure_key_vault_name }}" -tr http://timestamp.digicert.com -v $exePath
112+
# }; cd ..
113+
114+
# - name: Cleanup artifacts (Windows)
115+
# if: startsWith(matrix.os, 'windows')
116+
# run: |
117+
# mkdir dist/temp; Move-Item -Path dist/*.exe, dist/*.blockmap, dist/latest.yml -Destination dist/temp
118+
# npx rimraf "dist/!(temp)"
119+
# npx rimraf "dist/.icon-ico"
120+
# mv dist/temp/* dist
121+
# npx rimraf "dist/temp"
122+
123+
# - name: Upload artifacts (Windows)
124+
# uses: actions/upload-artifact@v2
125+
# if: startsWith(matrix.os, 'windows')
126+
# with:
127+
# name: ${{ matrix.os }}
128+
# path: dist
129+
130+
# - name: Release Electron app (Windows)
131+
# uses: softprops/action-gh-release@v1
132+
# if: startsWith(matrix.os, 'windows')
133+
# with:
134+
# draft: true
135+
# tag_name: v${{ steps.package_json.outputs.version }}
136+
# files: "dist/**"
137+
# env:
138+
# GITHUB_TOKEN: ${{ secrets.github_token }}

0 commit comments

Comments
 (0)