Skip to content

Commit a888be8

Browse files
committed
github: re-use PrimeXT's actions to upload artifacts to GitHub Releases
1 parent b3c1c17 commit a888be8

File tree

2 files changed

+50
-313
lines changed

2 files changed

+50
-313
lines changed

.github/workflows/c-cpp.yml

+50-21
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,22 @@ jobs:
3434
# targetos: motomagx
3535
# targetarch: armv6
3636

37-
- os: ubuntu-20.04
38-
targetos: nswitch
39-
targetarch: arm64
40-
- os: ubuntu-20.04
41-
targetos: psvita
42-
targetarch: armv7hf
43-
- os: windows-latest
44-
targetos: win32
45-
targetarch: amd64
46-
- os: windows-latest
47-
targetos: win32
48-
targetarch: i386
37+
# - os: ubuntu-20.04
38+
# targetos: nswitch
39+
# targetarch: arm64
40+
# - os: ubuntu-20.04
41+
# targetos: psvita
42+
# targetarch: armv7hf
43+
# - os: windows-latest
44+
# targetos: win32
45+
# targetarch: amd64
46+
# - os: windows-latest
47+
# targetos: win32
48+
# targetarch: i386
4949
env:
5050
SDL_VERSION: 2.26.2
5151
GH_CPU_ARCH: ${{ matrix.targetarch }}
52-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5352
ANDROID_SDK_TOOLS_VER: 4333796
54-
UPLOADTOOL_ISPRERELEASE: true
5553
steps:
5654
- name: Checkout
5755
uses: actions/checkout@v3
@@ -61,8 +59,6 @@ jobs:
6159
run: bash scripts/gha/deps_${{ matrix.targetos }}.sh
6260
- name: Build engine
6361
run: bash scripts/gha/build_${{ matrix.targetos }}.sh
64-
- name: Upload engine (prereleases)
65-
run: bash scripts/continious_upload.sh artifacts/*
6662
- name: Upload engine (artifacts)
6763
uses: actions/upload-artifact@v3
6864
with:
@@ -78,9 +74,6 @@ jobs:
7874
container:
7975
image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08
8076
options: --privileged
81-
env:
82-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83-
UPLOADTOOL_ISPRERELEASE: true
8477
steps:
8578
- name: Checkout
8679
uses: actions/checkout@v3
@@ -91,5 +84,41 @@ jobs:
9184
with:
9285
bundle: ${{ matrix.app }}.flatpak
9386
manifest-path: scripts/flatpak/${{ matrix.app }}.yml
94-
- name: Upload engine (prereleases)
95-
run: bash scripts/continious_upload.sh ${{ matrix.app }}.flatpak
87+
- name: Upload engine (artifacts)
88+
uses: actions/upload-artifact@v3
89+
with:
90+
name: artifact-${{ matrix.targetos }}-${{ matrix.targetarch }}
91+
path: artifacts/*
92+
release:
93+
name: "Upload releases"
94+
runs-on: ubuntu-latest
95+
needs: [build, flatpak]
96+
if: ${{ github.event_name == 'push' }}
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
steps:
100+
- name: Fetch artifacts
101+
uses: actions/[email protected]
102+
with:
103+
path: artifacts/
104+
- name: Repackage binaries
105+
working-directory: artifacts/
106+
run: |
107+
for i in artifact-*; do
108+
mv "$i"/* .
109+
rm -rf "$i"
110+
done
111+
- name: Remove old release
112+
uses: FWGS/[email protected]
113+
with:
114+
delete_release: true
115+
tag_name: ${{ github.ref_name == 'master' && 'continious' || format('continious-{0}', github.ref_name) }}
116+
- name: Upload new release
117+
uses: FWGS/[email protected]
118+
with:
119+
release_name: Xash3D FWGS Continious ${{ github.ref_name }} Build
120+
tag: ${{ github.ref_name == 'master' && 'continious' || format('continious-{0}', github.ref_name) }}
121+
prerelease: true
122+
repo_token: ${{ secrets.GITHUB_TOKEN }}
123+
file_glob: true
124+
file: artifacts/*

scripts/continious_upload.sh

-292
This file was deleted.

0 commit comments

Comments
 (0)