Publish #159
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
# Only trigger, when the build workflow succeeded | |
on: | |
workflow_run: | |
workflows: [Build] | |
types: [completed] | |
branches: [master] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare files | |
run: | | |
mkdir -p template/nblood/ | |
mkdir -p template/rednukem/ | |
mkdir -p template/pcexhumed/ | |
cp -a package/common/* template/nblood/ | |
cp -a package/common/* template/rednukem/ | |
cp -a package/common/* template/pcexhumed/ | |
cp README.md template/nblood/readme.txt | |
cp README.md template/rednukem/readme.txt | |
cp README.md template/pcexhumed/readme.txt | |
cp nblood.pk3 template/nblood/ | |
cp dn64widescreen.pk3 template/rednukem/ | |
cp pcexhumed.pk3 template/pcexhumed/ | |
- uses: dawidd6/action-download-artifact@v3 | |
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)-$revision.7z" * ; cd .. ; done ; cd .. ; done | |
- name: Publish | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ steps.create-7z-packages.outputs.revision }}" | |
prerelease: false | |
title: "${{ steps.create-7z-packages.outputs.revision }}" | |
files: | | |
upload/*.7z |