From 048f2040f170c512ec9f4781dcc7357c56b14e93 Mon Sep 17 00:00:00 2001 From: Fazri Gading Date: Wed, 21 Jan 2026 06:41:25 +0800 Subject: [PATCH] add more linux pkgs, create auto-release and pre-release feature for Github Actions --- .github/workflows/release.yml | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 61de406..5412f92 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Build and Release on: push: branches: - - main + - release tags: - 'v*' workflow_dispatch: @@ -13,12 +13,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - - name: Install dependencies for Pacman build - run: | - sudo apt-get update - sudo apt-get install -y libarchive-tools - - uses: actions/setup-node@v4 with: node-version: '22' @@ -31,6 +25,9 @@ jobs: path: | dist/*.AppImage dist/*.deb + dist/*.snap + dist/*.rpm + dist/*.pacman build-windows: runs-on: windows-latest @@ -69,7 +66,10 @@ jobs: release: needs: [build-linux, build-windows, build-macos] runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' + if: | + startsWith(github.ref, 'refs/tags/v') || + github.ref == 'refs/heads/release' || + github.event_name == 'workflow_dispatch' permissions: contents: write @@ -83,17 +83,22 @@ jobs: - name: Display structure of downloaded files run: ls -R artifacts + - name: Get version from package.json + id: pkg_version + run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT + - name: Create Release uses: softprops/action-gh-release@v2 with: - tag_name: ${{ github.ref_type == 'tag' && github.ref_name || format('manual-{0}', github.sha) }} - name: ${{ github.ref_type == 'tag' && github.ref_name || format('Manual build {0}', github.sha) }} + # If it's a tag, use the tag. + tag_name: ${{ github.ref_type == 'tag' && github.ref_name || format('v{0}-beta.{1}', steps.pkg_version.outputs.VERSION, github.run_number) }} + # If it's the 'release' branch, use 'v2.0.2-beta.run42' + name: ${{ github.ref_type == 'tag' && github.ref_name || format('Hytale-F2P v{0} (Beta Build {1})', steps.pkg_version.outputs.VERSION, github.run_number) }} files: | artifacts/linux-builds/**/* artifacts/windows-builds/**/* artifacts/macos-builds/**/* generate_release_notes: true - draft: false - prerelease: false - - + draft: true + # DYNAMIC FLAGS: Mark as pre-release ONLY IF it's NOT a tag (meaning it's a branch push) + prerelease: ${{ github.ref_type != 'tag' }}