-
Notifications
You must be signed in to change notification settings - Fork 78
57 lines (50 loc) · 1.74 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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@v3
- 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/
- 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)-$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