Skip to content

Commit

Permalink
github: re-use PrimeXT's actions to upload artifacts to GitHub Releases
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Mar 27, 2023
1 parent b3c1c17 commit dca4226
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 301 deletions.
47 changes: 38 additions & 9 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ jobs:
env:
SDL_VERSION: 2.26.2
GH_CPU_ARCH: ${{ matrix.targetarch }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ANDROID_SDK_TOOLS_VER: 4333796
UPLOADTOOL_ISPRERELEASE: true
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -61,8 +59,6 @@ jobs:
run: bash scripts/gha/deps_${{ matrix.targetos }}.sh
- name: Build engine
run: bash scripts/gha/build_${{ matrix.targetos }}.sh
- name: Upload engine (prereleases)
run: bash scripts/continious_upload.sh artifacts/*
- name: Upload engine (artifacts)
uses: actions/upload-artifact@v3
with:
Expand All @@ -78,9 +74,6 @@ jobs:
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08
options: --privileged
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPLOADTOOL_ISPRERELEASE: true
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -91,5 +84,41 @@ jobs:
with:
bundle: ${{ matrix.app }}.flatpak
manifest-path: scripts/flatpak/${{ matrix.app }}.yml
- name: Upload engine (prereleases)
run: bash scripts/continious_upload.sh ${{ matrix.app }}.flatpak
- name: Upload engine (artifacts)
uses: actions/upload-artifact@v3
with:
name: artifact-${{ matrix.targetos }}-${{ matrix.targetarch }}
path: artifacts/*
release:
name: "Upload releases"
runs-on: ubuntu-latest
needs: [build, flatpak]
if: ${{ github.event_name == 'push' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Fetch artifacts
uses: actions/[email protected]
with:
path: artifacts/
- name: Repackage binaries
working-directory: artifacts/
run: |
for i in artifact-* su.xash.Engine.*; do
mv "$i"/* .
rm -rf "$i"
done
- name: Remove old release
uses: FWGS/[email protected]
with:
delete_release: true
tag_name: ${{ github.ref_name == 'master' && 'continuous' || format('continuous-{0}', github.ref_name) }}
- name: Upload new release
uses: FWGS/[email protected]
with:
release_name: Xash3D FWGS Continuous ${{ github.ref_name }} Build
tag: ${{ github.ref_name == 'master' && 'continuous' || format('continuous-{0}', github.ref_name) }}
prerelease: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: artifacts/*
292 changes: 0 additions & 292 deletions scripts/continious_upload.sh

This file was deleted.

0 comments on commit dca4226

Please sign in to comment.