Skip to content

Commit

Permalink
ci: update
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Jul 22, 2024
1 parent 4c55117 commit 6b3e82b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 181 deletions.
91 changes: 6 additions & 85 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v4
- uses: docker/metadata-action@v5
name: generate tags
id: meta
with:
Expand All @@ -34,89 +34,10 @@ jobs:
type=ref,event=branch
type=sha,prefix=
type=semver,pattern={{version}}
- uses: docker/build-push-action@v3
- uses: docker/build-push-action@v5
with:
file: ./docker/Dockerfile
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
build-linux:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 'stable'
- name: Install dependencies
run: |
sudo apt install -y gcc-aarch64-linux-gnu
- name: Build amd64
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: amd64
run: |
go build -trimpath -o bin/linux_amd64/ -a -ldflags '-s -w' ./cmd/faucetd
- name: Build arm64
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: arm64
CC: aarch64-linux-gnu-gcc
run: |
go build -trimpath -o bin/linux_arm64/ -a -ldflags '-s -w' ./cmd/faucetd
- uses: actions/upload-artifact@v3
with:
name: faucetd-linux
path: bin/
retention-days: 30
build-mac:
runs-on: macos-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 'stable'
- name: Build amd64
env:
CGO_ENABLED: 1
GOOS: darwin
GOARCH: amd64
run: |
go build -trimpath -o bin/macos_amd64/ -a -ldflags '-s -w' ./cmd/faucetd
- name: Build arm64
env:
CGO_ENABLED: 1
GOOS: darwin
GOARCH: arm64
run: |
go build -trimpath -o bin/macos_arm64/ -a -ldflags '-s -w' ./cmd/faucetd
- uses: actions/upload-artifact@v3
with:
name: faucetd-macos
path: bin/
build-windows:
permissions:
contents: read
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 'stable'
- name: Build amd64
env:
CGO_ENABLED: 1
GOOS: windows
GOARCH: amd64
run: |
go build -trimpath -o bin/windows_amd64/ -a -ldflags '-s -w' ./cmd/faucetd
- uses: actions/upload-artifact@v3
with:
name: faucetd-macos
path: bin/
16 changes: 5 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,21 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest , macos-latest, windows-latest ]
go-version: [ '1.18', '1.19' ]
go-version: [ '1.21', '1.22' ]
steps:
- name: Configure Windows
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf false # fixes go lint fmt error
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Lint
uses: golangci/golangci-lint-action@v3
- name: Test Windows 1.18 # can't run race detector on windows with go 1.18 or lower due to a bug (https://github.com/golang/go/issues/46099)
if: matrix.os == 'windows-latest' && matrix.go-version == '1.18'
uses: n8maninger/action-golang-test@v1
with:
args: "-tags='testing';-timeout=300s"
uses: golangci/golangci-lint-action@v6
- name: Test
if: matrix.os != 'windows-latest' || matrix.go-version != '1.18'
uses: n8maninger/action-golang-test@v1
uses: n8maninger/action-golang-test@v2
with:
args: "-race;-tags='testing';-timeout=300s"
- name: Build
Expand Down
91 changes: 6 additions & 85 deletions .github/workflows/testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v4
- uses: docker/metadata-action@v5
name: generate tags
id: meta
with:
Expand All @@ -36,89 +36,10 @@ jobs:
type=ref,event=branch
type=sha,prefix=
type=semver,pattern={{version}}
- uses: docker/build-push-action@v3
- uses: docker/build-push-action@v5
with:
file: ./docker/Dockerfile.testnet
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
build-linux:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 'stable'
- name: Install dependencies
run: |
sudo apt install -y gcc-aarch64-linux-gnu
- name: Build amd64
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: amd64
run: |
go build -tags='netgo testnet' -trimpath -o bin/linux_amd64/ -a -ldflags '-s -w' ./cmd/faucetd
- name: Build arm64
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: arm64
CC: aarch64-linux-gnu-gcc
run: |
go build -tags='netgo testnet' -trimpath -o bin/linux_arm64/ -a -ldflags '-s -w' ./cmd/faucetd
- uses: actions/upload-artifact@v3
with:
name: faucetd-testnet-linux
path: bin/
retention-days: 30
build-mac:
runs-on: macos-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 'stable'
- name: Build amd64
env:
CGO_ENABLED: 1
GOOS: darwin
GOARCH: amd64
run: |
go build -tags='netgo testnet' -trimpath -o bin/macos_amd64/ -a -ldflags '-s -w' ./cmd/faucetd
- name: Build arm64
env:
CGO_ENABLED: 1
GOOS: darwin
GOARCH: arm64
run: |
go build -tags='netgo testnet' -trimpath -o bin/macos_arm64/ -a -ldflags '-s -w' ./cmd/faucetd
- uses: actions/upload-artifact@v3
with:
name: faucetd-testnet-macos
path: bin/
build-windows:
permissions:
contents: read
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 'stable'
- name: Build amd64
env:
CGO_ENABLED: 1
GOOS: windows
GOARCH: amd64
run: |
go build -tags='netgo testnet' -trimpath -o bin/windows_amd64/ -a -ldflags '-s -w' ./cmd/faucetd
- uses: actions/upload-artifact@v3
with:
name: faucetd-testnet-macos
path: bin/

0 comments on commit 6b3e82b

Please sign in to comment.