-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (51 loc) · 2.68 KB
/
main.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
58
59
60
61
62
name: Compile and release
on:
push:
branches:
main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set environment variables
run: echo SCRIPTS_PATH=$(pwd) >> $GITHUB_ENV && echo "NOW=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Download dependencies and additional plugins
working-directory: ${{ env.SCRIPTS_PATH }}/custom
run: |
sudo apt-get update && sudo apt-get install -y p7zip-full jq # Install `p7zip-full` and `jq`
wget -q -O tmp.zip https://github.com/agrastiOs/Ultimate-TF2-Visual-Fix-Pack/archive/refs/heads/master.zip && unzip -o tmp.zip -d mktemp/ && mv mktemp/Ultimate-TF2-Visual-Fix-Pack-master/TF2UltimateVisualFix/ ./ && rm -f tmp.zip && rm -rf mktemp/
wget -q -O tmp.zip https://github.com/dalegaard/CastingEssentials/releases/latest/download/CastingEssentialsRed.zip && CMD_INSTRUCTIONS=$(7z l -ba -slt "tmp.zip" | grep '\\' | sed 's/^Path = //g' | sed 's/.*/"&"/' | gawk '{ print $0, gensub(/\\/, "/", "g", $0); }' | sed 's|\\|\\\\|g' | paste -s -) && CMD_7Z="7z rn \"tmp.zip\" $CMD_INSTRUCTIONS" && eval "$CMD_7Z" && unzip -o tmp.zip -d ./ && rm -rf CastingEssentialsRed/resource && rm -f tmp.zip
wget -q -O tmp.zip https://github.com/CriticalFlaw/essentialsHUD/archive/refs/heads/fortress-faceoff.zip && unzip -o tmp.zip -d mktemp/ && rm -f mktemp/essentialsHUD-fortress-faceoff/resource/clientscheme.res && rsync -a --no-perms mktemp/essentialsHUD-fortress-faceoff/ essentialsHUD-fortress-faceoff/ && rm -f tmp.zip && rm -rf mktemp/
- name: Rename Readme
working-directory: ${{ env.SCRIPTS_PATH }}
run: |
mv README.md readme.txt
- name: Install zip
uses: montudor/action-zip@v1
- name: Zip output
run: |
zip -qq -y -r "${{ github.event.repository.name }}.zip" custom cfg readme.txt
working-directory: ${{ env.SCRIPTS_PATH }}
- name: List files in the directory
run: ls -R
working-directory: ${{ env.SCRIPTS_PATH }}
- name: List files in the zip
run: unzip -l ${{ github.event.repository.name }}.zip
working-directory: ${{ env.SCRIPTS_PATH }}
- name: Create Release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.NOW }}
artifacts: "${{ github.event.repository.name }}.zip"
draft: false
allowUpdates: true
prerelease: false
generateReleaseNotes: true
replacesArtifacts: true