Skip to content

Commit

Permalink
add nfpm build package deb 10
Browse files Browse the repository at this point in the history
  • Loading branch information
a-wing committed Nov 11, 2024
1 parent 419dec9 commit eeebf1e
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit eeebf1e

Please sign in to comment.