Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c9593baf5d | |||
| f1896d2e00 | |||
| 101f33b80b |
@@ -0,0 +1,105 @@
|
||||
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.zip
|
||||
unzip -q tic80-v1.1-linux.zip
|
||||
chmod +x tic80
|
||||
|
||||
- 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' }}
|
||||
Reference in New Issue
Block a user