From ebbe2521bc7dd4e22ae43754cbe34ce8d8aff5df Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Sun, 15 Jun 2025 14:22:11 +0800 Subject: [PATCH] Add `push` event trigger for `pkg-deb.yml` [GitHub #202] --- .github/workflows/pkg-deb.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pkg-deb.yml b/.github/workflows/pkg-deb.yml index c6391d9..dd479ad 100644 --- a/.github/workflows/pkg-deb.yml +++ b/.github/workflows/pkg-deb.yml @@ -5,6 +5,8 @@ name: Build and Publish DEB Package on: release: types: [ released ] + push: + branches: [ "gh-build" ] workflow_dispatch: inputs: version: @@ -26,6 +28,8 @@ jobs: if [ "${{ github.event_name }}" = "release" ]; then version="${{ github.event.release.tag_name }}" version=${version#v} # Remove 'v' prefix if present + elif [ "${{ github.event_name }}" = "push" ];then + version="9.9.9" # Default version for push events (temporarily) else version="${{ github.event.inputs.version }}" fi @@ -111,7 +115,7 @@ jobs: path: dist/chsrc_*.deb retention-days: 30 - - name: Upload to release + - name: Upload to Releases (the newest release) if is release event if: github.event_name == 'release' uses: actions/upload-release-asset@v1 env: @@ -122,6 +126,20 @@ jobs: asset_name: chsrc_${{ steps.get_version.outputs.version }}-1_amd64.deb asset_content_type: application/vnd.debian.binary-package + + - name: Upload to Releases (the 'pre' release) if is push event + if: github.event_name == 'push' + uses: softprops/action-gh-release@v1 + with: + tag_name: pre + files: | + dist/chsrc_*_amd64.deb + token: ${{ secrets.UPLOAD_TO_GITHUB }} + + + + + create-repository-metadata: needs: build-deb runs-on: ubuntu-latest