What are you doing Wednesday #26
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: "Electron" | |
on: | |
release: | |
types: [created] | |
jobs: | |
electron-build: | |
if: github.actor == 'solcloud' | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: "Install Linux dependencies" | |
timeout-minutes: 3 | |
run: | | |
sudo apt-get update && sudo apt-get install -y \ | |
npm zip curl | |
- name: "Install Node dependencies" | |
timeout-minutes: 3 | |
run: | | |
cd electron/ | |
npm install | |
- name: "Build Electron apps" | |
timeout-minutes: 5 | |
run: | | |
cd electron/ | |
rm -rf build/ | |
npm run build | |
zip -r linux.zip build/build-linux*/ | |
zip -r windows.zip build/build-win*/ | |
zip -r macos.zip build/build-mas*/ | |
- name: "Publish Linux Artifact" | |
timeout-minutes: 5 | |
env: | |
RELEASE_ID: ${{ github.event.release.id }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "release: $RELEASE_ID" | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-H "Content-Type: application/zip" \ | |
"https://uploads.github.com/repos/solcloud/Counter-Strike/releases/${RELEASE_ID}/assets?name=client-linux.zip" \ | |
--data-binary "@electron/linux.zip" | |
- name: "Publish Windows Artifact" | |
timeout-minutes: 5 | |
env: | |
RELEASE_ID: ${{ github.event.release.id }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "release: $RELEASE_ID" | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-H "Content-Type: application/zip" \ | |
"https://uploads.github.com/repos/solcloud/Counter-Strike/releases/${RELEASE_ID}/assets?name=client-windows.zip" \ | |
--data-binary "@electron/windows.zip" | |
- name: "Publish MacOS Artifact" | |
timeout-minutes: 5 | |
env: | |
RELEASE_ID: ${{ github.event.release.id }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "release: $RELEASE_ID" | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-H "Content-Type: application/zip" \ | |
"https://uploads.github.com/repos/solcloud/Counter-Strike/releases/${RELEASE_ID}/assets?name=client-macos.zip" \ | |
--data-binary "@electron/macos.zip" |