Files
Lucksmith/.gitea/workflows/build.yml
T
nick 6737b804ff
Build TIC-80 Cartridge / Build PNG Cartridge (push) Failing after 7s
Build TIC-80 Cartridge / Build Releases (tic80, linux, https://github.com/nesbox/TIC-80/releases/download/v1.1.2837/tic80-v1.1-linux.zip) (push) Has been skipped
Build TIC-80 Cartridge / Build Releases (tic80.exe, windows, https://github.com/nesbox/TIC-80/releases/download/v1.1.2837/tic80-v1.1-windows.zip) (push) Has been skipped
chore: getting steps working
2025-12-08 20:54:58 +13:00

105 lines
3.2 KiB
YAML

name: Build TIC-80 Cartridge
on:
push:
branches:
- main
- master
tags:
- 'v*'
jobs:
build-cartridge:
name: Build PNG Cartridge
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install TIC-80
run: |
wget -q https://github.com/nesbox/TIC-80/releases/download/v1.1.2837/tic80-v1.1-linux.deb -O tic80.deb
sudo dpkg -i tic80.deb || sudo apt-get install -f -y
- name: Export PNG cartridge
run: |
tic80 --skip --cli --cmd="load lucksmith.lua & export lucksmith.png & exit"
- name: Upload PNG cartridge as artifact
uses: actions/upload-artifact@v4
with:
name: lucksmith-cartridge
path: lucksmith.png
- name: Commit PNG cartridge
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: |
git config user.name "Gitea Actions"
git config user.email "actions@gitea.local"
git add lucksmith.png
git diff --staged --quiet || git commit -m "Update PNG cartridge [skip ci]"
git push
build-releases:
name: Build Releases
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: build-cartridge
strategy:
matrix:
include:
- platform: linux
url: https://github.com/nesbox/TIC-80/releases/download/v1.1.2837/tic80-v1.1-linux.zip
binary: tic80
- platform: windows
url: https://github.com/nesbox/TIC-80/releases/download/v1.1.2837/tic80-v1.1-windows.zip
binary: tic80.exe
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download TIC-80
run: |
wget -q ${{ matrix.url }} -O tic80.zip
unzip -q tic80.zip
- name: Download PNG cartridge
uses: actions/download-artifact@v4
with:
name: lucksmith-cartridge
- name: Prepare release package
run: |
mkdir -p release
cp ${{ matrix.binary }} release/
cp lucksmith.png release/
cp lucksmith.lua release/
cd release
if [ "${{ matrix.platform }}" = "windows" ]; then
zip -r ../lucksmith-${{ matrix.platform }}.zip .
else
tar czf ../lucksmith-${{ matrix.platform }}.tar.gz .
fi
- name: Create Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./lucksmith-${{ matrix.platform }}.${{ matrix.platform == 'windows' && 'zip' || 'tar.gz' }}
asset_name: lucksmith-${{ matrix.platform }}-${{ github.ref_name }}.${{ matrix.platform == 'windows' && 'zip' || 'tar.gz' }}
asset_content_type: application/${{ matrix.platform == 'windows' && 'zip' || 'gzip' }}