0948d01b87
Build TIC-80 Cartridge / Build PNG Cartridge (push) Failing after 3s
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
107 lines
3.3 KiB
YAML
107 lines
3.3 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: |
|
|
sudo dpkg -i ./tools/tic80-v1.1-linux-pro.deb || sudo apt-get install -f -y
|
|
- name: Install OpenGL Dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libgl1
|
|
- name: Export PNG cartridge
|
|
run: |
|
|
tic80 --fs=. --skip --cli --cmd="load lucksmith.lua & save lucksmith.png & exit"
|
|
|
|
- name: Upload PNG cartridge as artifact
|
|
uses: https://github.com/bencurio/gitea-upload-artifact
|
|
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' }}
|