Skip to content

fix(buffer): clear loaded on insert #544

fix(buffer): clear loaded on insert

fix(buffer): clear loaded on insert #544

Workflow file for this run

name: Package
on:
- push
- pull_request
- workflow_dispatch
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
EXAMPLES_ARTIFACT_NAME: ${{ vars.PRODUCT_NAME_SC }}-examples
IDE_DEBUG_APK_NAME: ${{ vars.PRODUCT_NAME }}-IDE-debug.apk
PLAYER_DEBUG_APK_NAME: ${{ vars.PRODUCT_NAME }}-player-debug.apk
IDE_APK_NAME: ${{ vars.PRODUCT_NAME }}-IDE-release.apk
PLAYER_APK_NAME: ${{ vars.PRODUCT_NAME }}-player-release.apk
LOVE_APPIMAGE: ${{ vars.PRODUCT_NAME_ANSI }}.AppImage
LOVE_DEB: ${{ vars.PRODUCT_NAME_ANSI }}.deb
LOVE_JS: ${{ vars.PRODUCT_NAME }}-web.zip
LOVE_JS_C: ${{ vars.PRODUCT_NAME }}-web-compat.zip
jobs:
run-busted:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: jkl1337/gh-actions-lua@v11
with:
# luaVersion: "5.1"
luaVersion: "luajit-git"
- uses: jkl1337/gh-actions-luarocks@v5
with:
luarocksVersion: "3.12.0"
- name: install dependencies
run: |
luarocks install busted
luarocks install luautf8
luarocks install luafilesystem
- name: run unit tests
run: busted tests -o utfTerminal
build-love:
runs-on: ubuntu-latest
needs:
- run-busted
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 0
fetch-tags: true
- name: install just
uses: extractions/setup-just@v2
- name: Add versioninfo
run: |
just version
- 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@v4
with:
name: ${{ env.LOVE_ARTIFACT_NAME }}
path: ${{ env.OUTPUT_FOLDER }}/${{ env.LOVE_ARTIFACT_NAME }}
- name: upload
uses: actions/upload-artifact@v4
with:
name: game.love
path: ${{ env.OUTPUT_FOLDER }}/${{ env.LOVE_ARTIFACT_NAME }}
build-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Just
uses: extractions/setup-just@v3
- name: Package examples
run: just zip-examples-all
- name: upload
uses: actions/upload-artifact@v4
with:
compression-level: 0
name: ${{ env.EXAMPLES_ARTIFACT_NAME }}
path: ${{ env.OUTPUT_FOLDER }}/*.compy
build-linux:
runs-on: ubuntu-latest
needs: build-love
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 0
fetch-tags: "true"
- name: Download love package
uses: actions/download-artifact@v4
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: compy-toys/love-actions-linux@v2.0.2
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@v4
with:
name: ${{ env.LOVE_DEB }}
path: ${{ env.OUTPUT_FOLDER }}/${{ env.LOVE_DEB }}
- name: upload AppImage
uses: actions/upload-artifact@v4
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'
steps:
- name: install node
uses: actions/setup-node@v4
with:
node-version: "lts/Iron"
- name: install just
uses: extractions/setup-just@v2
- uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 0
fetch-tags: "true"
- name: Download love package
uses: actions/download-artifact@v4
with:
name: ${{ env.LOVE_ARTIFACT_NAME }}
- name: Build web package
run: |
just setup-web-dev
just package-web
just package-web-c
- name: upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.LOVE_JS }}
path: ${{ env.OUTPUT_FOLDER }}/${{ env.LOVE_JS }}
- name: upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.LOVE_JS_C }}
path: ${{ env.OUTPUT_FOLDER }}/${{ env.LOVE_JS_C }}
deploy-staging:
runs-on: ubuntu-latest
needs: build-web
if: github.event_name == 'push' && endsWith(github.repository, '-dev')
environment: staging
steps:
- name: Download package
uses: actions/download-artifact@v4
with:
name: ${{ env.LOVE_JS }}
- name: Setup ssh
env:
STAGING: ${{ secrets.STAGING }}
PORT: ${{ secrets.SSH_PORT }}
USER: ${{ secrets.STAGING_USER }}
SSH_KEY: ${{ secrets.STAGING_SSH_KEY }}
run: |
mkdir -p ~/.ssh
umask 077
cat > ~/.ssh/config << EOF
Host staging
Hostname $STAGING
Port $PORT
User $USER
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
IdentityFile ~/.ssh/deploy.key
EOF
echo "$SSH_KEY" > ~/.ssh/deploy.key
ssh-keyscan -H $STAGING || true >> ~/.ssh/known_hosts
- name: Deploy package
env:
PACKAGE: ${{ env.LOVE_JS }}
STAGING: ${{ secrets.STAGING }}
TDIR: public/latest
run: |
rsync $PACKAGE staging:
ssh staging "7z -y -o$TDIR x $PACKAGE"
- name: Deploy package for tag
if: startsWith(github.ref, 'refs/tags/')
env:
PACKAGE: ${{ env.LOVE_JS }}
STAGING: ${{ secrets.STAGING }}
TDIR: public/
run: |
TAG_NAME="${GITHUB_REF#refs/tags/}"
CH=${GITHUB_SHA::7}
rsync $PACKAGE staging:
ssh staging "7z -y -o$TDIR/$CH x $PACKAGE"
ssh staging "ln -sfT $CH $TDIR/$TAG_NAME ; chmod +rx $TDIR/*"
build-android:
runs-on: ubuntu-latest
needs: build-love
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
ACTIONS_STEP_DEBUG: true
GRADLE_OPTS: "-Dorg.gradle.jvmargs='-Xmx4G'"
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-tags: "true"
fetch-depth: 0
- name: Download love package
uses: actions/download-artifact@v4
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: compy-toys/love-actions-android@v0.2.6
with:
love-ref: "compy"
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 }}
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@v4
with:
name: ${{ env.IDE_DEBUG_APK_NAME }}
path: ${{ env.OUTPUT_FOLDER }}/${{ env.IDE_DEBUG_APK_NAME }}
- name: upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.PLAYER_DEBUG_APK_NAME }}
path: ${{ env.OUTPUT_FOLDER }}/${{ env.PLAYER_DEBUG_APK_NAME }}
- name: upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.IDE_APK_NAME }}
path: ${{ env.OUTPUT_FOLDER }}/${{ env.IDE_APK_NAME }}
- name: upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.PLAYER_APK_NAME }}
path: ${{ env.OUTPUT_FOLDER }}/${{ env.PLAYER_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@v4
with:
name: ${{ env.LOVE_ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: actions/download-artifact@v4
with:
name: ${{ env.LOVE_APPIMAGE }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: actions/download-artifact@v4
with:
name: ${{ env.LOVE_DEB }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: actions/download-artifact@v4
with:
name: ${{ env.LOVE_JS }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: actions/download-artifact@v4
with:
name: ${{ env.LOVE_JS_C }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: actions/download-artifact@v4
with:
name: ${{ env.IDE_DEBUG_APK_NAME }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: actions/download-artifact@v4
continue-on-error: true
with:
name: ${{ env.IDE_APK_NAME }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: actions/download-artifact@v4
with:
name: ${{ env.PLAYER_DEBUG_APK_NAME }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: actions/download-artifact@v4
continue-on-error: true
with:
name: ${{ env.PLAYER_APK_NAME }}
path: ${{ env.ARTIFACT_FOLDER }}
- uses: sigstore/gh-action-sigstore-python@v3.0.0
with:
inputs: ${{ env.ARTIFACT_FOLDER }}/*
# these don't need a signature
- uses: actions/download-artifact@v4
with:
name: ${{ env.EXAMPLES_ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_FOLDER }}
- name: control
run: ls -lR ${{ env.ARTIFACT_FOLDER }}/
- name: Checksums
run: |
cd ${{ env.ARTIFACT_FOLDER }}
sha256sum * > SHA256SUMS.txt
- name: control
run: ls -lR ${{ env.ARTIFACT_FOLDER }}/
- name: Release
uses: softprops/action-gh-release@v2.0.1
with:
files: ${{ env.ARTIFACT_FOLDER }}/*