
* ci, go.mod: bump to go 1.23 Now that go.mod matches our go version, we can stop setting go version in CI separately. Signed-off-by: Casey Callendrello <c1@caseyc.net> * minor: fix lint errors Bumping golangci-lint to v1.61 introduced some new reasonable checks; fix the errors they found. Signed-off-by: Casey Callendrello <c1@caseyc.net> * ci: bump golangci-lint to v1.61.0 Also, fix some deprecated config directives. Signed-off-by: Casey Callendrello <c1@caseyc.net> --------- Signed-off-by: Casey Callendrello <c1@caseyc.net>
115 lines
3.6 KiB
YAML
115 lines
3.6 KiB
YAML
---
|
|
name: Release binaries
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
linux_release:
|
|
name: Release linux binaries
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
goarch: [amd64, arm, arm64, mips64le, ppc64le, riscv64, s390x]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Build
|
|
env:
|
|
GOARCH: ${{ matrix.goarch }}
|
|
CGO_ENABLED: 0
|
|
run: ./build_linux.sh -ldflags '-extldflags -static -X github.com/containernetworking/plugins/pkg/utils/buildversion.BuildVersion=${{ github.ref_name }}'
|
|
|
|
- name: COPY files
|
|
run: cp README.md LICENSE bin/
|
|
|
|
- name: Change plugin file ownership
|
|
working-directory: ./bin
|
|
run: sudo chown -R root:root .
|
|
|
|
- name: Create dist directory
|
|
run: mkdir dist
|
|
|
|
- name: Create archive file
|
|
working-directory: ./bin
|
|
run: tar cfzpv ../dist/cni-plugins-linux-${{ matrix.goarch }}-${{ github.ref_name }}.tgz .
|
|
|
|
- name: Create sha256 checksum
|
|
working-directory: ./dist
|
|
run: sha256sum cni-plugins-linux-${{ matrix.goarch }}-${{ github.ref_name }}.tgz | tee cni-plugins-linux-${{ matrix.goarch }}-${{ github.ref_name }}.tgz.sha256
|
|
|
|
- name: Create sha512 checksum
|
|
working-directory: ./dist
|
|
run: sha512sum cni-plugins-linux-${{ matrix.goarch }}-${{ github.ref_name }}.tgz | tee cni-plugins-linux-${{ matrix.goarch }}-${{ github.ref_name }}.tgz.sha512
|
|
|
|
- name: Upload binaries to release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: ./dist/*
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|
|
file_glob: true
|
|
|
|
windows_releases:
|
|
name: Release windows binaries
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
goarch: [amd64]
|
|
steps:
|
|
- name: Install dos2unix
|
|
run: sudo apt-get install dos2unix
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Build
|
|
env:
|
|
GOARCH: ${{ matrix.goarch }}
|
|
CGO_ENABLED: 0
|
|
run: ./build_windows.sh -ldflags '-extldflags -static -X github.com/containernetworking/plugins/pkg/utils/buildversion.BuildVersion=${{ github.ref_name }}'
|
|
|
|
- name: COPY files
|
|
run: cp README.md LICENSE bin/
|
|
|
|
- name: Change plugin file ownership
|
|
working-directory: ./bin
|
|
run: sudo chown -R root:root .
|
|
|
|
- name: Create dist directory
|
|
run: mkdir dist
|
|
|
|
- name: Create archive file
|
|
working-directory: ./bin
|
|
run: tar cpfzv ../dist/cni-plugins-windows-${{ matrix.goarch }}-${{ github.ref_name }}.tgz .
|
|
|
|
- name: Create sha256 checksum
|
|
working-directory: ./dist
|
|
run: sha256sum cni-plugins-windows-${{ matrix.goarch }}-${{ github.ref_name }}.tgz | tee cni-plugins-windows-${{ matrix.goarch }}-${{ github.ref_name }}.tgz.sha256
|
|
|
|
- name: Create sha512 checksum
|
|
working-directory: ./dist
|
|
run: sha512sum cni-plugins-windows-${{ matrix.goarch }}-${{ github.ref_name }}.tgz | tee cni-plugins-windows-${{ matrix.goarch }}-${{ github.ref_name }}.tgz.sha512
|
|
|
|
- name: Upload binaries to release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: ./dist/*
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|
|
file_glob: true
|