Skip to content

Make Release

Make Release #159

Workflow file for this run

# 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: PenAndPaper
artifact: PenAndPaper
tileset_dir: gfx/PenAndPaper
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