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 a888be8
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 313 deletions.
71 changes: 50 additions & 21 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,22 @@ jobs:
# targetos: motomagx
# targetarch: armv6

- os: ubuntu-20.04
targetos: nswitch
targetarch: arm64
- os: ubuntu-20.04
targetos: psvita
targetarch: armv7hf
- os: windows-latest
targetos: win32
targetarch: amd64
- os: windows-latest
targetos: win32
targetarch: i386
# - os: ubuntu-20.04
# targetos: nswitch
# targetarch: arm64
# - os: ubuntu-20.04
# targetos: psvita
# targetarch: armv7hf
# - os: windows-latest
# targetos: win32
# targetarch: amd64
# - os: windows-latest
# targetos: win32
# targetarch: i386
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-*; 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' && 'continious' || format('continious-{0}', github.ref_name) }}
- name: Upload new release
uses: FWGS/[email protected]
with:
release_name: Xash3D FWGS Continious ${{ github.ref_name }} Build
tag: ${{ github.ref_name == 'master' && 'continious' || format('continious-{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 a888be8

Please sign in to comment.