diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb94c6fc4a..e88ddc2d24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: | @@ -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: @@ -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}} @@ -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}} @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 76efc5891b..778a51b011 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,6 +13,7 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Prepare files run: | mkdir -p template/nblood/ @@ -26,6 +27,7 @@ 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 @@ -33,20 +35,23 @@ jobs: 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