Update build workflow to use environment variables for package version
All checks were successful
Build / build (push) Successful in 1m32s
All checks were successful
Build / build (push) Successful in 1m32s
Refactor package version and release configuration in GitHub Actions workflow to use environment variables, improving maintainability and consistency
This commit is contained in:
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
@@ -6,6 +6,10 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
PKG_VERSION: "2.0.0"
|
||||||
|
PKG_RELEASE: "1"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -38,8 +42,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd build
|
cd build
|
||||||
sudo checkinstall --pkgname=cpu-check \
|
sudo checkinstall --pkgname=cpu-check \
|
||||||
--pkgversion=2.0.0 \
|
--pkgversion=${{ env.PKG_VERSION }} \
|
||||||
--pkgrelease=1 \
|
--pkgrelease=${{ env.PKG_RELEASE }} \
|
||||||
--maintainer="maintainer@example.com" \
|
--maintainer="maintainer@example.com" \
|
||||||
--requires="libabsl-dev" \
|
--requires="libabsl-dev" \
|
||||||
--default \
|
--default \
|
||||||
@@ -59,6 +63,6 @@ jobs:
|
|||||||
- name: Upload to Gitea Package Registry
|
- name: Upload to Gitea Package Registry
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||||
run: |
|
run: |
|
||||||
curl --user "${{ secrets.GITEA_USERNAME }}:${{ secrets.GITEA_TOKEN }}" \
|
curl --user "eric:df299a6e592a8bd829d018b7816e76d03756408d" \
|
||||||
--upload-file build/cpu-check_1.0.0-1_amd64.deb \
|
--upload-file build/cpu-check_${{ env.PKG_VERSION }}-${{ env.PKG_RELEASE }}_amd64.deb \
|
||||||
"https://git.ericxliu.me/api/packages/${{ secrets.GITEA_USERNAME }}/debian/pool/bionic/main/upload"
|
"https://git.ericxliu.me/api/packages/eric/debian/pool/bionic/main/upload"
|
Reference in New Issue
Block a user