Skip to content

feat: add clock example #100

feat: add clock example

feat: add clock example #100

Workflow file for this run

name: Package
on: [push, pull_request]
env:
PRODUCT_NAME: ${{ vars.PRODUCT_NAME }}
PRODUCT_NAME_ANSI: ${{ vars.PRODUCT_NAME_ANSI }}
PRODUCT_NAME_SC: ${{ vars.PRODUCT_NAME_SC }}
BUNDLE_ID: com.example.${{ vars.PRODUCT_NAME_SC }}
BUILD_TYPE: ${{ fromJSON('["dev", "release"]')[startsWith(github.ref, 'refs/tags/v')] }}
OUTPUT_FOLDER: dist
ARTIFACT_FOLDER: artifact
LOVE_ARTIFACT_NAME: ${{ vars.PRODUCT_NAME_SC }}.love
LOVE_DEBUG_APK_NAME: ${{ vars.PRODUCT_NAME }}-debug.apk
LOVE_APK_NAME: ${{ vars.PRODUCT_NAME }}-release.apk
LOVE_APPIMAGE: ${{ vars.PRODUCT_NAME_ANSI }}.AppImage
LOVE_DEB: ${{ vars.PRODUCT_NAME_ANSI }}.deb
LOVE_JS: ${{ vars.PRODUCT_NAME }}.web.zip
jobs:
run-busted:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "true"
- uses: leafo/gh-actions-lua@v10
with:
# luaVersion: "5.3"
luaVersion: "luajit-2.1.0-beta3"
- uses: leafo/gh-actions-luarocks@v4
with:
luarocksVersion: "3.9.2"
- name: install dependencies
run: |
luarocks --local install busted
luarocks --local install luautf8
- name: run unit tests
run: busted tests -o utfTerminal
build-love:
runs-on: ubuntu-latest
needs:
- run-busted
steps:
- uses: actions/checkout@v3
with:
submodules: "true"
- name: Build bare love package
uses: love-actions/love-actions-core@v1
with:
build-list: "./src/*"
package-path: ${{ env.OUTPUT_FOLDER }}/${{ env.LOVE_ARTIFACT_NAME }}
- name: upload
uses: actions/upload-artifact@v3
with:
name: ${{ env.LOVE_ARTIFACT_NAME }}
path: ${{ env.OUTPUT_FOLDER }}/${{ env.LOVE_ARTIFACT_NAME }}
- name: upload
uses: actions/upload-artifact@v3
with:
name: game.love
path: ${{ env.OUTPUT_FOLDER }}/${{ env.LOVE_ARTIFACT_NAME }}
build-linux:
runs-on: ubuntu-latest
needs: build-love
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
with:
submodules: "true"
- name: Download love package
uses: actions/download-artifact@v3
with:
name: ${{ env.LOVE_ARTIFACT_NAME }}
# path: ${{ env.ARTIFACT_FOLDER }}/${{ env.LOVE_ARTIFACT_NAME }}
- name: Build Linux packages
env:
ACTIONS_STEP_DEBUG: true
id: build-packages
uses: love-actions/love-actions-linux@v1
with:
app-name: ${{ env.PRODUCT_NAME }}
bundle-id: ${{ env.BUNDLE_ID }}
love-package: ${{ env.LOVE_ARTIFACT_NAME }}
# love-package: ${{ env.ARTIFACT_FOLDER }}/${{ env.LOVE_ARTIFACT_NAME }}
product-name: ${{ env.PRODUCT_NAME_ANSI }}
output-folder: ${{ env.OUTPUT_FOLDER }}
icon-path: ./src/assets/example_icon.png
- name: upload .deb
uses: actions/upload-artifact@v3
with:
name: ${{ env.LOVE_DEB }}
path: ${{ env.OUTPUT_FOLDER }}/${{ env.LOVE_DEB }}
- name: upload AppImage
uses: actions/upload-artifact@v3
with:
name: ${{ env.LOVE_APPIMAGE }}
path: ${{ env.OUTPUT_FOLDER }}/${{ env.LOVE_APPIMAGE }}
build-web:
runs-on: ubuntu-latest
needs: build-love
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Download love package
uses: actions/download-artifact@v3
with:
name: ${{ env.LOVE_ARTIFACT_NAME }}
- name: Build HTML
run: |
sudo apt install nodejs
npm i -g love.js
love.js -c ${{ env.LOVE_ARTIFACT_NAME }} ./${{ env.OUTPUT_FOLDER }} --title "LÖVEputer" --memory 67108864
7z a ${{ env.ARTIFACT_FOLDER }}/${{ env.LOVE_JS }} ./${{ env.OUTPUT_FOLDER }}/*
- name: upload
uses: actions/upload-artifact@v3
with:
name: ${{ env.LOVE_JS }}
path: ${{ env.ARTIFACT_FOLDER }}
build-android:
runs-on: ubuntu-latest
needs: build-love
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
ACTIONS_STEP_DEBUG: true
steps:
- uses: actions/checkout@v3
with:
submodules: "true"
- name: Download love package
uses: actions/download-artifact@v3
with:
name: game.love
path: ./
- name: sed version code
id: sub
env:
VER: ${{ github.ref_name }}
run: echo VER_CODE="$(echo $VERSION | sed -e 's/^v//' -e 's/\.//g')" >> $GITHUB_ENV
- name: Package for android
uses: aldum/[email protected]
with:
love-ref: "main"
no-soft-keyboard: "enabled"
app-name: ${{ env.PRODUCT_NAME }}
bundle-id: ${{ env.BUNDLE_ID }}
resource-path: "./res/android"
product-name: ${{ env.PRODUCT_NAME }}
version-string: ${{ github.ref_name }}
version-code: ${{ env.VER_CODE }}
output-folder: ${{ env.OUTPUT_FOLDER }}
love-package: ${{ env.LOVE_ARTIFACT_NAME }}
icon-specifier: "@drawable/${{ env.PRODUCT_NAME_SC }}"
keystore-alias: ${{ secrets.ANDROID_KEYSTORE_ALIAS }}
keystore-base64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
keystore-key-password: ${{ secrets.ANDROID_KEYSTORE_KEYPASSWORD }}
keystore-store-password: ${{ secrets.ANDROID_KEYSTORE_STOREPASSWORD }}
- name: upload
uses: actions/upload-artifact@v3
with:
name: ${{ env.LOVE_DEBUG_APK_NAME }}
path: ${{ env.OUTPUT_FOLDER }}/${{ env.LOVE_DEBUG_APK_NAME }}
- name: upload
uses: actions/upload-artifact@v3
with:
name: ${{ env.LOVE_APK_NAME }}
path: ${{ env.OUTPUT_FOLDER }}/${{ env.LOVE_APK_NAME }}
release:
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs:
- build-love
- build-linux
- build-web
- build-android
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ env.LOVE_ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: actions/download-artifact@v3
with:
name: ${{ env.LOVE_APPIMAGE }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: actions/download-artifact@v3
with:
name: ${{ env.LOVE_DEB }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: actions/download-artifact@v3
with:
name: ${{ env.LOVE_JS }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: actions/download-artifact@v3
with:
name: ${{ env.LOVE_DEBUG_APK_NAME }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: actions/download-artifact@v3
with:
name: ${{ env.LOVE_APK_NAME }}
path: ${{ env.ARTIFACT_FOLDER }}
- name: control
run: ls -lR ${{ env.ARTIFACT_FOLDER }}/
- name: Checksums
run: |
cd ${{ env.ARTIFACT_FOLDER }}
sha256sum * > SHA256SUMS.txt
- uses: sigstore/[email protected]
with:
inputs: ${{ env.ARTIFACT_FOLDER }}/*
- name: control
run: ls -lR ${{ env.ARTIFACT_FOLDER }}/
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{ env.ARTIFACT_FOLDER }}/*