Skip to content

chore(deps): bump dependencies (#328) #1153

chore(deps): bump dependencies (#328)

chore(deps): bump dependencies (#328) #1153

Workflow file for this run

name: CI
env:
PACKAGES: openvpn crossbuild-essential-arm64 libssl-dev:arm64
# renovate: github=golangci/golangci-lint
GO_LINT_CI_VERSION: v1.61.0
# renovate: github=goreleaser/goreleaser
GORELEASER_VERSION: v2.3.2
on:
workflow_dispatch:
pull_request:
push:
tags:
- 'v*'
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
name: Build & Test
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: 'go.mod'
- run: go mod tidy -diff
- run: go build
- run: go test ./... -timeout 20s -race -covermode=atomic -coverprofile=coverage.out -coverpkg=./...
- run: go test ./... -timeout 20s -bench . -benchmem -count 3
- name: Install build dependencies
run: |
sudo dpkg --add-architecture arm64
sudo sed -i'' -E 's/^(deb|deb-src) /\1 [arch=amd64,i386] /' /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ $(lsb_release -cs) main restricted universe" | sudo tee /etc/apt/sources.list.d/arm64.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ $(lsb_release -cs)-updates main restricted universe" | sudo tee -a /etc/apt/sources.list.d/arm64.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ $(lsb_release -cs)-security main restricted universe" | sudo tee -a /etc/apt/sources.list.d/arm64.list
sudo apt-get update -q
sudo apt-get install --no-install-recommends -qy $PACKAGES
- name: Write gpg sign key
if: env.GPG_KEY != null
run: echo "$GPG_KEY" > "$GPG_KEY_PATH"
env:
GPG_KEY_PATH: "${{ secrets.GPG_KEY_PATH }}"
GPG_KEY: ${{ secrets.GPG_KEY }}
- name: go build (with goreleaser)
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6
with:
version: ${{ env.GORELEASER_VERSION }}
args: release --snapshot
env:
GITHUB_TOKEN: ""
GPG_KEY_PATH: ""
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: dists
path: dist/
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
with:
version: ${{ env.GO_LINT_CI_VERSION }}
publish:
name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs:
- build
- lint
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Install build dependencies
run: |
sudo dpkg --add-architecture arm64
sudo sed -i'' -E 's/^(deb|deb-src) /\1 [arch=amd64,i386] /' /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ $(lsb_release -cs) main restricted universe" | sudo tee /etc/apt/sources.list.d/arm64.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ $(lsb_release -cs)-updates main restricted universe" | sudo tee -a /etc/apt/sources.list.d/arm64.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ $(lsb_release -cs)-security main restricted universe" | sudo tee -a /etc/apt/sources.list.d/arm64.list
sudo apt-get update -q
sudo apt-get install --no-install-recommends -qy $PACKAGES
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: 'go.mod'
- name: Write gpg sign key
run: echo "$GPG_KEY" > "$GPG_KEY_PATH"
env:
GPG_KEY_PATH: "${{ secrets.GPG_KEY_PATH }}"
GPG_KEY: ${{ secrets.GPG_KEY }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6
with:
version: ${{ env.GORELEASER_VERSION }}
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}
NFPM_OPENVPN-AUTH-OAUTH2_PASSPHRASE: ${{ secrets.NFPM_PASSPHRASE }}
GPG_KEY_PATH: ${{ secrets.GPG_KEY_PATH }}