86 lines
2.8 KiB
YAML
Raw Permalink Normal View History

2022-10-18 22:33:34 +02:00
name: "Electron"
on:
2022-12-04 13:33:27 +01:00
release:
types: [created]
2022-10-18 22:33:34 +02:00
jobs:
electron-build:
2023-09-27 15:22:17 +02:00
if: github.actor == 'solcloud'
permissions:
contents: write
2022-10-18 22:33:34 +02:00
runs-on: ubuntu-latest
steps:
2024-09-13 15:41:10 +02:00
- uses: actions/checkout@v4
2022-10-24 17:44:28 +02:00
with:
persist-credentials: false
2022-10-18 22:33:34 +02:00
- name: "Install Linux dependencies"
timeout-minutes: 3
run: |
sudo apt-get update && sudo apt-get install -y \
2023-09-27 15:22:17 +02:00
npm zip curl
2022-10-18 22:33:34 +02:00
- 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
2023-09-27 15:22:17 +02:00
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"
2022-10-18 22:33:34 +02:00
- name: "Publish Windows Artifact"
timeout-minutes: 5
2023-09-27 15:22:17 +02:00
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"
2022-10-18 22:33:34 +02:00
- name: "Publish MacOS Artifact"
timeout-minutes: 5
2023-09-27 15:22:17 +02:00
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"