-
Notifications
You must be signed in to change notification settings - Fork 3
72 lines (64 loc) · 2.35 KB
/
release.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
63
64
65
66
67
68
69
70
71
72
name: release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout latest commit
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Read version file and build file names
id: read_version
run: |
echo "version=$(cat About/Version.txt)" >> $GITHUB_OUTPUT
echo "version_v=v$(cat About/Version.txt)" >> $GITHUB_OUTPUT
echo "mp_zip=Map_Preview_v$(cat About/Version.txt).zip" >> $GITHUB_OUTPUT
- name: Create MP release zip
uses: thedoctor0/zip-release@0.7.1
with:
type: 'zip'
filename: ${{ steps.read_version.outputs.mp_zip }}
exclusions: '/.git/* /Sources/* /AddOn/* /.github/* .git* *.pdb'
- name: Read changelog
id: read_changelog
run: |
awk -v RS= 'NR==2 {print > ("LatestChanges.txt")}' Changelog.md
echo 'changes<<EOF' >> $GITHUB_OUTPUT
echo "$(cat LatestChanges.txt)" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
echo 'changes_h<<EOF' >> $GITHUB_OUTPUT
echo "Update $(cat About/Version.txt)" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "$(cat LatestChanges.txt)" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Publish release
uses: ncipollo/release-action@v1
with:
artifacts: ${{ format('{0}', steps.read_version.outputs.mp_zip) }}
body: ${{ steps.read_changelog.outputs.changes }}
name: ${{ format('Map Preview v{0}', steps.read_version.outputs.version) }}
tag: ${{ steps.read_version.outputs.version }}
commit: ${{ github.sha }}
makeLatest: true
- name: Extract zip for workshop upload
env:
ZIP_FILE: ${{ steps.read_version.outputs.mp_zip }}
run: |
sudo apt-get install unzip
mkdir ws-upload/
unzip $ZIP_FILE -d ws-upload
- name: Upload to workshop
uses: m00nl1ght-dev/steam-workshop-deploy@main
with:
username: ${{ secrets.STEAM_ACCOUNT }}
configVdf: ${{ secrets.STEAM_CONFIG_VDF }}
appId: 294100
publishedFileId: 2800857642
path: ws-upload
changeNote: ${{ steps.read_changelog.outputs.changes_h }}