diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f34ef4a2..211743fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,7 @@ jobs: - name: Calculate version if: github.event_name != 'workflow_dispatch' run: |- - go run -v ./cmd/internal/read_tag --nightly + go run -v ./cmd/internal/read_tag --ci --nightly - name: Set outputs id: outputs run: |- @@ -165,6 +165,9 @@ jobs: PKG_NAME="sing-box_${{ needs.calculate_version.outputs.version }}_${{ matrix.os }}_${{ matrix.arch }}${ARM_VERSION}" echo "DIR_NAME=${DIR_NAME}" >> "${GITHUB_ENV}" echo "PKG_NAME=${PKG_NAME}" >> "${GITHUB_ENV}" + PKG_VERSION="${{ needs.calculate_version.outputs.version }}" + PKG_VERSION="${PKG_VERSION//-/\~}" + echo "PKG_VERSION=${PKG_VERSION}" >> "${GITHUB_ENV}" - name: Package DEB if: matrix.debian != '' run: | @@ -172,7 +175,7 @@ jobs: sudo gem install fpm sudo apt-get install -y debsigs fpm -t deb \ - -v "${{ needs.calculate_version.outputs.version }}" \ + -v "$PKG_VERSION" \ -p "dist/${PKG_NAME}.deb" \ --architecture ${{ matrix.debian }} \ dist/sing-box=/usr/bin/sing-box @@ -189,7 +192,7 @@ jobs: set -xeuo pipefail sudo gem install fpm fpm -t rpm \ - -v "${{ needs.calculate_version.outputs.version }}" \ + -v "$PKG_VERSION" \ -p "dist/${PKG_NAME}.rpm" \ --architecture ${{ matrix.rpm }} \ dist/sing-box=/usr/bin/sing-box @@ -208,7 +211,7 @@ jobs: sudo gem install fpm sudo apt-get install -y libarchive-tools fpm -t pacman \ - -v "${{ needs.calculate_version.outputs.version }}" \ + -v "$PKG_VERSION" \ -p "dist/${PKG_NAME}.pkg.tar.zst" \ --architecture ${{ matrix.pacman }} \ dist/sing-box=/usr/bin/sing-box @@ -218,8 +221,8 @@ jobs: cd dist mkdir -p "${DIR_NAME}" cp ../LICENSE "${DIR_NAME}" - if [ '${{ matrix.os }}' = 'windoes' ]; then - cp sing-box.exe "${DIR_NAME}" + if [ '${{ matrix.os }}' = 'windows' ]; then + cp sing-box "${DIR_NAME}/sing-box.exe" zip -r "${DIR_NAME}.zip" "${DIR_NAME}" else cp sing-box "${DIR_NAME}" @@ -305,9 +308,9 @@ jobs: LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }} - name: Prepare upload run: |- - mkdir -p dist/release - cp clients/android/app/build/outputs/apk/play/release/*.apk dist/release - cp clients/android/app/build/outputs/apk/other/release/*-universal.apk dist/release + mkdir -p dist + cp clients/android/app/build/outputs/apk/play/release/*.apk dist + cp clients/android/app/build/outputs/apk/other/release/*-universal.apk dist - name: Upload artifact uses: actions/upload-artifact@v4 with: @@ -555,9 +558,9 @@ jobs: zip -r SFM.dSYMs.zip dSYMs popd - mkdir -p dist/release - cp clients/apple/SFM.dmg "dist/release/SFM-${VERSION}-universal.dmg" - cp "clients/apple/${{ matrix.archive }}/SFM.dSYMs.zip" "dist/release/SFM-${VERSION}-universal.dSYMs.zip" + mkdir -p dist + cp clients/apple/SFM.dmg "dist/SFM-${VERSION}-universal.dmg" + cp "clients/apple/${{ matrix.archive }}/SFM.dSYMs.zip" "dist/SFM-${VERSION}-universal.dSYMs.zip" - name: Upload image if: matrix.if && matrix.name == 'macOS-standalone' && github.event_name == 'workflow_dispatch' uses: actions/upload-artifact@v4 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 87b0738f..965929df 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -34,7 +34,7 @@ jobs: - name: Calculate version if: github.event_name != 'workflow_dispatch' run: |- - go run -v ./cmd/internal/read_tag --nightly + go run -v ./cmd/internal/read_tag --ci --nightly - name: Set outputs id: outputs run: |- @@ -109,6 +109,11 @@ jobs: if: contains(needs.calculate_version.outputs.version, '-') run: |- echo "NAME=sing-box-beta" >> "$GITHUB_ENV" + - name: Set version + run: |- + PKG_VERSION="${{ needs.calculate_version.outputs.version }}" + PKG_VERSION="${PKG_VERSION//-/\~}" + echo "PKG_VERSION=${PKG_VERSION}" >> "${GITHUB_ENV}" - name: Package DEB if: matrix.debian != '' run: | @@ -116,10 +121,11 @@ jobs: sudo gem install fpm sudo apt-get install -y debsigs fpm -t deb \ - -v "${{ needs.calculate_version.outputs.version }}" \ + --name "${NAME}" \ + -v "$PKG_VERSION" \ -p "dist/${NAME}_${{ needs.calculate_version.outputs.version }}_linux_${{ matrix.debian }}.deb" \ --architecture ${{ matrix.debian }} \ - dist/sing-box=/usr/bin/${NAME} + dist/sing-box=/usr/bin/sing-box curl -Lo '/tmp/debsigs.diff' 'https://gitlab.com/debsigs/debsigs/-/commit/160138f5de1ec110376d3c807b60a37388bc7c90.diff' sudo patch /usr/bin/debsigs < '/tmp/debsigs.diff' rm -rf $HOME/.gnupg @@ -133,10 +139,11 @@ jobs: set -xeuo pipefail sudo gem install fpm fpm -t rpm \ - -v "${{ needs.calculate_version.outputs.version }}" \ + --name "${NAME}" \ + -v "$PKG_VERSION" \ -p "dist/${NAME}_${{ needs.calculate_version.outputs.version }}_linux_${{ matrix.rpm }}.rpm" \ --architecture ${{ matrix.rpm }} \ - dist/sing-box=/usr/bin/${NAME} + dist/sing-box=/usr/bin/sing-box cat > $HOME/.rpmmacros <