Skip to content

Commit

Permalink
build(github): 👷 use env files for nfpm build
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed Apr 24, 2024
1 parent e69d6f6 commit 10ad4c3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.amd64
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
# https://opensource.org/licenses/MIT

export PKG_ARCH=amd64
export NFPM_ARCH=amd64
2 changes: 2 additions & 0 deletions .env.arm
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ export CC=arm-linux-gnueabihf-gcc
export CC_PKG=gcc-arm-linux-gnueabihf
export PKG_ARCH=armhf
export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig
export GOARCH=arm
export GOARM=7
export NFPM_ARCH=arm7
2 changes: 2 additions & 0 deletions .env.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ export CC=aarch64-linux-gnu-gcc
export CC_PKG=gcc-aarch64-linux-gnu
export PKG_ARCH=arm64
export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
export GOARCH=arm64
export NFPM_ARCH=arm64
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
echo "::notice title=App Version::${APPVERSION}"
- name: Add ${{ matrix.arch }} package repos
if: ${{ matrix.arch }} != "amd64"
if: ${{ matrix.arch }} != amd64
id: enable_multiarch
run: |
source .env.${{ matrix.arch }}
Expand Down Expand Up @@ -105,7 +105,6 @@ jobs:
go build -o dist/go-hass-agent-${{ matrix.arch }}
env:
CGO_ENABLED: 1
GOARCH: ${{ matrix.arch }}
MATRIX_ARCH: ${{ matrix.arch }}

# - name: Build with fyne-cross
Expand All @@ -118,7 +117,7 @@ jobs:
- name: Create package
id: nfpm_package
run: |
export NFPM_ARCH=$(go env GOARCH)$(go env GOARM)
source .env.${{ matrix.arch }}
nfpm package --config .nfpm.yaml --packager rpm --target dist
nfpm package --config .nfpm.yaml --packager deb --target dist
nfpm package --config .nfpm.yaml --packager archlinux --target dist
Expand All @@ -141,13 +140,15 @@ jobs:
COSIGN_PWD: ${{ secrets.COSIGN_PWD }}

- name: Upload build artifacts
id: upload_artifacts
if: ! ${{ steps.release_please.outputs.release_created }}
uses: actions/upload-artifact@v4
with:
name: ${APPVERSION}
path: dist/*.{rpm,deb,zst,sig} fync-cross/dist/linux-${{ matrix.arch }}/*.{tar.xz,sig}

- name: Upload release artifacts
id: upload_release
if: ${{ steps.release_please.outputs.release_created }}
run: >
gh release upload ${{ steps.release_please.outputs.tag_name }}
Expand Down

0 comments on commit 10ad4c3

Please sign in to comment.