From eeebf1eb2a85ee87254f45aab14e53976464cd80 Mon Sep 17 00:00:00 2001 From: a-wing <1@233.email> Date: Mon, 11 Nov 2024 17:36:21 +0800 Subject: [PATCH] add nfpm build package deb 10 --- .github/workflows/release.yml | 60 +++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 32099ae..33dd5b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,6 @@ jobs: - { target: x86_64-unknown-linux-gnu , os: ubuntu-24.04, use-cross: true } - { target: x86_64-unknown-linux-musl , os: ubuntu-24.04, use-cross: true, nfpm: amd64 } env: - VERSION: $GITHUB_REF_NAME BUILD_CMD: cargo EXE_SUFFIX: "" PKG_LIVE777_NAME: "" @@ -55,8 +54,14 @@ jobs: run: npm run build - name: Get the release version from the tag + shell: bash run: | - echo "version is: ${{ env.VERSION }}" + VERSION=${GITHUB_REF_NAME} + if expr "${VERSION}" : '[^0-9]*$' > /dev/null; then + VERSION=v0.0.0 + fi + echo "VERSION=${VERSION}" >> $GITHUB_ENV + echo "version is: ${VERSION}" - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable @@ -157,40 +162,39 @@ jobs: - name: Set nFPM environment if: ${{ matrix.job.nfpm }} run: | - echo "NFPM_ARCH=${{ matrix.job.nfpm }}" >> $GITHUB_ENV - echo "NFPM_TARGET=${{ matrix.job.target }}" >> $GITHUB_ENV - # echo "NFPM_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV - echo "NFPM_VERSION=v0.0.0" >> $GITHUB_ENV + echo "NFPM_ARCH=${{ matrix.job.nfpm }}" >> $GITHUB_ENV + echo "NFPM_TARGET=${{ matrix.job.target }}" >> $GITHUB_ENV + echo "NFPM_VERSION=${{ env.VERSION }}" >> $GITHUB_ENV - name: Build nFPM config if: ${{ matrix.job.nfpm }} run: | - envsubst < nfpm/live777.yaml > live777.yaml - envsubst < nfpm/liveman.yaml > liveman.yaml - envsubst < nfpm/net4mqtt.yaml > net4mqtt.yaml - envsubst < nfpm/whipinto.yaml > whipinto.yaml - envsubst < nfpm/whepfrom.yaml > whepfrom.yaml + envsubst < nfpm/live777.yaml > live777.yaml + envsubst < nfpm/liveman.yaml > liveman.yaml + envsubst < nfpm/net4mqtt.yaml > net4mqtt.yaml + envsubst < nfpm/whipinto.yaml > whipinto.yaml + envsubst < nfpm/whepfrom.yaml > whepfrom.yaml - name: Use nFPM if: ${{ matrix.job.nfpm }} run: | - nfpm pkg --packager deb --config live777.yaml - nfpm pkg --packager deb --config liveman.yaml - nfpm pkg --packager deb --config net4mqtt.yaml - nfpm pkg --packager deb --config whipinto.yaml - nfpm pkg --packager deb --config whepfrom.yaml + nfpm pkg --packager deb --config live777.yaml + nfpm pkg --packager deb --config liveman.yaml + nfpm pkg --packager deb --config net4mqtt.yaml + nfpm pkg --packager deb --config whipinto.yaml + nfpm pkg --packager deb --config whepfrom.yaml - name: Use nFPM list if: ${{ matrix.job.nfpm }} shell: bash run: | - ls -l - echo ${GITHUB_REF_NAME} - echo "live777_${GITHUB_REF_NAME}_${ARCH}.deb" - echo ${VERSION} - echo ${VERSION}_${ARCH} - echo "live777_${VERSION}_${ARCH}.deb" - echo "live777_${{ env.VERSION }}_${ARCH}.deb" + ls -l + echo ${GITHUB_REF_NAME} + echo "live777_${GITHUB_REF_NAME}_${ARCH}.deb" + echo ${VERSION} + echo ${VERSION}_${ARCH} + echo "live777_${VERSION}_${ARCH}.deb" + echo "live777_${{ env.VERSION }}_${ARCH}.deb" - name: Rename binary shell: bash @@ -204,11 +208,11 @@ jobs: with: name: ${{ matrix.job.target }}_binary path: | - ${{ env.TAR_LIVE777_NAME }} - ${{ env.TAR_LIVEMAN_NAME }} - ${{ env.PKG_WHEPFROM_NAME }} - ${{ env.PKG_WHIPINTO_NAME }} - ${{ env.PKG_NET4MQTT_NAME }} + ${{ env.TAR_LIVE777_NAME }} + ${{ env.TAR_LIVEMAN_NAME }} + ${{ env.PKG_WHEPFROM_NAME }} + ${{ env.PKG_WHIPINTO_NAME }} + ${{ env.PKG_NET4MQTT_NAME }} - name: Artifact Upload debian uses: actions/upload-artifact@v4