Skip to content

Offline gym log for Android. No account, no ads, no internet.

Self-host workflow: test run without a release

InlitXe3c23263ecb8
diff --git a/.github/workflows/selfhost.yml b/.github/workflows/selfhost.yml
index 4eb5c0f..83d3b96 100644
--- a/.github/workflows/selfhost.yml
+++ b/.github/workflows/selfhost.yml
@@ -4,8 +4,9 @@ on:
workflow_dispatch:
inputs:
tag:
- description: 'Release tag to attach the files to, e.g. v2.2.0'
- required: true
+ description: 'Release tag to attach the files to, e.g. v2.2.0. Leave empty for a test run'
+ required: false
+ default: ''
type: string
permissions:
@@ -23,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
- ref: ${{ inputs.tag }}
+ ref: ${{ inputs.tag || github.ref }}
- uses: subosito/flutter-action@v2
with:
@@ -54,7 +55,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
- ref: ${{ inputs.tag }}
+ ref: ${{ inputs.tag || github.ref }}
- uses: dart-lang/setup-dart@v1
with:
@@ -87,7 +88,15 @@ jobs:
Set-Content -Path package/gymmane/start.bat -Value "@echo off`r`ncd /d %~dp0`r`ngymmane-server.exe`r`npause"
Compress-Archive -Path package/gymmane -DestinationPath gymmane-selfhost-${{ matrix.name }}.zip
+ - name: Keep the files (test run)
+ if: inputs.tag == ''
+ uses: actions/upload-artifact@v4
+ with:
+ name: gymmane-selfhost-${{ matrix.name }}
+ path: gymmane-selfhost-${{ matrix.name }}.*
+
- name: Attach to the release
+ if: inputs.tag != ''
shell: bash
env:
GH_TOKEN: ${{ github.token }}
@@ -99,13 +108,14 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
- ref: ${{ inputs.tag }}
+ ref: ${{ inputs.tag || github.ref }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
+ if: inputs.tag != ''
with:
registry: ghcr.io
username: ${{ github.actor }}
@@ -117,13 +127,13 @@ jobs:
echo "image=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/gymmane" >> "$GITHUB_OUTPUT"
echo "version=${TAG#v}" >> "$GITHUB_OUTPUT"
env:
- TAG: ${{ inputs.tag }}
+ TAG: ${{ inputs.tag || 'test' }}
- uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
- push: true
+ push: ${{ inputs.tag != '' }}
build-args: FLUTTER_VERSION=${{ env.FLUTTER_VERSION }}
tags: |
${{ steps.name.outputs.image }}:latest