Skip to content

Commit

Permalink
CI: Keep old releases after publishing to GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
CommonLoon102 authored and Hendricks266 committed Aug 3, 2023
1 parent 206fd02 commit 0b68698
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@ jobs:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3

- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
cache: true
install: git mingw-w64-${{matrix.env}}-toolchain make ${{matrix.pkg}}

- name: build
run: |
git fetch --unshallow
make -j2 duke3d sw blood rr exhumed kenbuild tools SDLCONFIG= ${{matrix.opt}}
- name: prepare artifacts
if: github.ref == 'refs/heads/master'
run: |
Expand All @@ -48,6 +51,7 @@ jobs:
cp nblood.exe upload/nblood/
cp rednukem.exe upload/rednukem/
cp pcexhumed.exe upload/pcexhumed/
- uses: actions/upload-artifact@v2
if: github.ref == 'refs/heads/master'
with:
Expand All @@ -71,12 +75,14 @@ jobs:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3

- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
update: true
cache: true
install: git mingw-w64-${{matrix.env}}-toolchain make ${{matrix.pkg}}

- name: build
run: make -j2 duke3d sw blood rr exhumed kenbuild tools SDLCONFIG= ${{matrix.opt}}

Expand All @@ -103,10 +109,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: install-prerequisites
run: |
sudo apt-get update
sudo apt-get -y install libflac-dev libvpx-dev libgtk2.0-dev ${{matrix.pkg}}
- name: build
run: make -j2 duke3d sw blood rr exhumed kenbuild tools ${{matrix.opt}}

Expand All @@ -115,9 +123,11 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3

- name: install-prerequisites
run: |
brew install sdl2 flac libvpx make
brew unlink lz4
- name: build
run: gmake -j2 duke3d sw blood rr exhumed kenbuild tools
11 changes: 8 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Prepare files
run: |
mkdir -p template/nblood/
Expand All @@ -26,27 +27,31 @@ jobs:
cp README.md template/pcexhumed/readme.txt
cp nblood.pk3 template/nblood/
cp dn64widescreen.pk3 template/rednukem/
- uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
workflow_conclusion: success
path: upload/

- name: Package
id: create-7z-packages
run: |
sudo apt-get update
sudo apt-get install 7zip
git fetch --unshallow
revision="r$(git rev-list --count HEAD)"
echo "revision=$revision" >> $GITHUB_OUTPUT
cd upload/
ls -R
for i in */ ; do cd "$i" ; cp -a ../../template/* ./ ; for j in */ ; do cd "$j" ; 7zz a -mx9 -ms=on -t7z -m0=lzma2 -mmt2 "../../${j%/}_${i%/}_$(date +%Y%m%d)-r$(git rev-list --count HEAD).7z" * ; cd .. ; done ; cd .. ; done
for i in */ ; do cd "$i" ; cp -a ../../template/* ./ ; for j in */ ; do cd "$j" ; 7zz a -mx9 -ms=on -t7z -m0=lzma2 -mmt2 "../../${j%/}_${i%/}_$(date +%Y%m%d)-$revision.7z" * ; cd .. ; done ; cd .. ; done
- name: Publish
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
automatic_release_tag: "${{ steps.create-7z-packages.outputs.revision }}"
prerelease: false
title: "Latest Build"
title: "${{ steps.create-7z-packages.outputs.revision }}"
files: |
upload/*.7z

0 comments on commit 0b68698

Please sign in to comment.