-
Notifications
You must be signed in to change notification settings - Fork 172
127 lines (118 loc) · 4.46 KB
/
make_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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Creates a release using compose.py from https://github.com/CleverRaven/Cataclysm-DDA
#
# This action is runs at 20:00 UTC Sunday
name: Make Release
concurrency: release
on:
schedule:
- cron: '0 20 * * sun'
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
permissions: write-all
outputs:
timestamp: ${{ steps.timestamp.outputs.time }}
steps:
- name: Get build timestamp
id: timestamp
run: |
# serves as a release's tag
echo "time=$(/bin/date -u "+%Y-%m-%d")" >> $GITHUB_OUTPUT
- id: rel-data
run: |
echo "RELEASE-TITLE=Tilesets Release ${{ steps.timestamp.outputs.time }}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
- run: |
gh release create "${{ steps.timestamp.outputs.time }}" --generate-notes --title "${{ steps.rel-data.outputs.RELEASE-TITLE }}"
builds:
needs: release
strategy:
fail-fast: false
matrix:
include:
- name: Altica
artifact: Altica
tileset_dir: gfx/Altica
compose_args: --use-all --obsolete-fillers
- name: ASCII_Overmap
artifact: ASCII_Overmap
tileset_dir: gfx/ASCII_Overmap
compose_args: --use-all
- name: BrownLikeBears
artifact: BrownLikeBears
tileset_dir: gfx/BrownLikeBears
compose_args: --use-all --obsolete-fillers
- name: ChibiUltica
artifact: ChibiUltica
tileset_dir: gfx/Chibi_Ultica
compose_args: --use-all
- name: HollowMoon
artifact: HollowMoon
tileset_dir: gfx/HollowMoon
compose_args: --use-all --obsolete-fillers
- name: Larwick_Overmap
artifact: Larwick_Overmap
tileset_dir: gfx/Larwick_Overmap
compose_args: --use-all
- name: MShockXotto+
artifact: MshockXotto+
tileset_dir: gfx/MShockXotto+
compose_args: --use-all
- name: NeoDays
artifact: NeoDaysTileset
tileset_dir: gfx/NeoDays
compose_args: --use-all
- name: Retrodays
artifact: RetroDaysTileset
tileset_dir: gfx/Retrodays
compose_args: --use-all
- name: GiantDays
artifact: GiantDays
tileset_dir: gfx/GiantDays
compose_args: --use-all
- name: SmashButton_iso
artifact: SmashButton_iso
tileset_dir: gfx/HitButton_iso
compose_args: --use-all
- name: SurveyorsMap
artifact: SurveyorsMap
tileset_dir: gfx/SurveyorsMap
compose_args: --use-all
- name: UltimateCataclysm
artifact: UltimateCataclysm
tileset_dir: gfx/UltimateCataclysm
compose_args: --use-all --obsolete-fillers
- name: Ultica_iso
artifact: Ultica_iso
tileset_dir: gfx/Ultica_iso
compose_args: --use-all
name: ${{ matrix.name }}
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Install Dependencies
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: musl python3 python3-pip libvips42
# re-installing libvips; caching it won't set it up the way we need it
# still cache it because we'll make it work somehow
- run: sudo apt-get update; sudo apt-get install libvips42
- run: pip3 install pyvips
- uses: actions/checkout@v4
- name: Build ${{ matrix.name }}
run: |
wget -q https://raw.githubusercontent.com/CleverRaven/Cataclysm-DDA/master/tools/gfx_tools/compose.py
mkdir build
python3 compose.py ${{ matrix.compose_args }} --feedback CONCISE --loglevel INFO --format-json "${{ matrix.tileset_dir }}" build
release_name=${{ matrix.artifact }}
mkdir $release_name
cp -r build/* $release_name
mv ${{ matrix.tileset_dir }}/tileset.txt $release_name
[ -f "${{ matrix.tileset_dir }}/fallback.png" ] && mv "${{ matrix.tileset_dir }}/fallback.png" $release_name
[ -f "${{ matrix.tileset_dir }}/layering.json" ] && mv "${{ matrix.tileset_dir }}/layering.json" $release_name
zip -r $release_name.zip $release_name
gh release upload ${{ needs.release.outputs.timestamp }} $release_name.zip