Skip to content

Commit

Permalink
ci: compile in multi arch
Browse files Browse the repository at this point in the history
  • Loading branch information
JM-Lemmi committed Apr 17, 2024
1 parent f131b61 commit 6d90fa7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/compile.yml
Expand Up @@ -7,6 +7,9 @@ on:
jobs:
Compile:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -15,7 +18,7 @@ jobs:
with:
go-version: '1.18.0' # The Go version to download (if necessary) and use.
- run: go generate cmd/ical-relay/main.go
- run: go build -o ./bin/ical-relay ./cmd/ical-relay/
- run: env GOOS=linux GOARCH={{ matrix.arch }} go build -o ./bin/ical-relay ./cmd/ical-relay/
- uses: actions/upload-artifact@v3
with:
name: ical-relay
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/package.yml
Expand Up @@ -48,6 +48,9 @@ jobs:

Compile:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -56,15 +59,18 @@ jobs:
with:
go-version: '1.18.0' # The Go version to download (if necessary) and use.
- run: go generate cmd/ical-relay/main.go
- run: go build -o ./bin/ical-relay ./cmd/ical-relay/ && strip ./bin/ical-relay
- run: env GOOS=linux GOARCH={{ matrix.arch }} go build -o ./bin/ical-relay ./cmd/ical-relay/ && strip ./bin/ical-relay
- uses: actions/upload-artifact@v3
with:
name: ical-relay
name: ical-relay_{{ matrix.arch }}
path: ./bin/ical-relay

Package-deb:
needs: Compile
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -86,22 +92,22 @@ jobs:
uses: actions/download-artifact@v3
id: download
with:
name: ical-relay
name: ical-relay_{{ matrix.arch }}
- run: |
mkdir -p cmd/ical-relay/.debpkg/usr/bin
cp ${{steps.download.outputs.download-path}}/ical-relay cmd/ical-relay/.debpkg/usr/bin/
chmod +x cmd/ical-relay/.debpkg/usr/bin/ical-relay
chmod +x cmd/ical-relay/.debpkg/usr/bin/ical-relay_{{ matrix.arch }}
- uses: jiro4989/build-deb-action@v2
id: package
with:
package: ical-relay
package_root: ./cmd/ical-relay/.debpkg
maintainer: Julian Lemmerich <mail@julian-lemmerich.de>
version: ${{ github.ref }} # refs/tags/v*.*.*
arch: 'amd64'
arch: '{{ matrix.arch }}'
desc: 'Relay ical urls and edit them on the fly with different modules.'
- uses: actions/upload-artifact@v3
with:
name: ical-relay.deb
name: ical-relay_{{ matrix.arch }}.deb
path: ${{steps.package.outputs.file_name}}

0 comments on commit 6d90fa7

Please sign in to comment.