Skip to content

Commit

Permalink
Add release upload action
Browse files Browse the repository at this point in the history
  • Loading branch information
solcloud committed Sep 27, 2023
1 parent ca08553 commit 350dd9f
Showing 1 changed file with 43 additions and 16 deletions.
59 changes: 43 additions & 16 deletions .github/workflows/electron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:

jobs:
electron-build:
if: github.actor == 'solcloud'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -15,7 +18,7 @@ jobs:
timeout-minutes: 3
run: |
sudo apt-get update && sudo apt-get install -y \
npm zip
npm zip curl
- name: "Install Node dependencies"
timeout-minutes: 3
Expand All @@ -35,24 +38,48 @@ jobs:
- name: "Publish Linux Artifact"
timeout-minutes: 5
uses: actions/upload-artifact@v3
with:
name: counter-strike-football-linux.zip
path: electron/linux.zip
if-no-files-found: error
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
uses: actions/upload-artifact@v3
with:
name: counter-strike-football-windows.zip
path: electron/windows.zip
if-no-files-found: error
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
uses: actions/upload-artifact@v3
with:
name: counter-strike-football-macos.zip
path: electron/macos.zip
if-no-files-found: error
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"

0 comments on commit 350dd9f

Please sign in to comment.