zrok/.github/workflows/release.yml

255 lines
6.0 KiB
YAML
Raw Normal View History

2022-11-02 20:22:34 +01:00
name: Release
on:
push:
tags:
2022-11-03 18:55:22 +01:00
- 'v*.*.*'
2022-11-02 20:22:34 +01:00
2023-02-08 17:40:27 +01:00
# grant write permission to GITHUB_TOKEN for goreleaser
permissions:
contents: write
2022-11-02 20:22:34 +01:00
jobs:
2023-02-08 17:40:27 +01:00
build-linux-amd64:
runs-on: ubuntu-20.04
2022-11-02 20:22:34 +01:00
steps:
- run: sudo apt update
2022-11-02 21:51:44 +01:00
- run: sudo apt-get install gcc-multilib g++-multilib
2022-11-02 21:58:33 +01:00
2022-11-02 20:22:34 +01:00
- uses: actions/checkout@v3
2022-11-02 21:00:21 +01:00
with:
fetch-depth: 0
- run: git fetch --force --tags
2022-11-02 20:22:34 +01:00
2022-11-02 21:00:21 +01:00
- uses: actions/setup-go@v3
2022-11-02 20:22:34 +01:00
with:
2023-08-11 17:19:22 +02:00
go-version: '>=1.21.0'
2022-11-02 21:00:21 +01:00
cache: true
2022-11-02 20:22:34 +01:00
2022-11-02 21:00:21 +01:00
- uses: actions/setup-node@v3
2022-11-02 20:22:34 +01:00
with:
2023-08-11 17:19:22 +02:00
node-version: 18.x
2022-11-02 20:22:34 +01:00
- run: npm install
working-directory: ui
- run: npm run build
working-directory: ui
env:
CI: "true"
2022-11-02 20:22:34 +01:00
2022-11-02 21:00:21 +01:00
- uses: goreleaser/goreleaser-action@v2
2022-11-02 20:22:34 +01:00
with:
2022-11-02 21:00:21 +01:00
distribution: goreleaser
version: latest
2022-11-03 18:55:22 +01:00
args: release --skip-publish --config .goreleaser-linux.yml
2022-11-02 20:22:34 +01:00
env:
2022-11-02 21:00:21 +01:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-11-03 18:55:22 +01:00
2022-11-03 21:52:34 +01:00
- uses: actions/upload-artifact@v3
2022-11-03 18:55:22 +01:00
with:
2022-11-03 21:51:22 +01:00
name: release-builds
path: ./dist/*.gz
2023-02-08 17:40:27 +01:00
build-linux-arm64:
runs-on: ubuntu-20.04
steps:
- run: sudo apt update
2023-02-08 17:40:27 +01:00
- run: sudo apt-get install gcc-aarch64-linux-gnu
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
2023-08-11 17:19:22 +02:00
go-version: '>=1.21.0'
2023-02-08 17:40:27 +01:00
cache: true
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm install
working-directory: ui
- run: npm run build
working-directory: ui
env:
CI: "true"
2023-02-08 17:40:27 +01:00
- uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --skip-publish --config .goreleaser-linux-arm64.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: release-builds
path: ./dist/*.gz
2023-01-30 17:42:22 +01:00
build-linux-arm:
runs-on: ubuntu-20.04
steps:
- run: sudo apt update
2023-01-30 17:42:22 +01:00
- run: sudo apt-get install gcc-arm-linux-gnueabi
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
2023-08-11 17:19:22 +02:00
go-version: '>=1.21.0'
2023-01-30 17:42:22 +01:00
cache: true
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm install
working-directory: ui
- run: npm run build
working-directory: ui
env:
CI: "true"
2023-01-30 17:42:22 +01:00
- uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
2023-02-08 17:40:27 +01:00
args: release --skip-publish --config .goreleaser-linux-armhf.yml
2023-01-30 17:42:22 +01:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: release-builds
path: ./dist/*.gz
2022-11-03 21:51:22 +01:00
build-darwin:
runs-on: macos-latest
steps:
2022-11-08 17:08:17 +01:00
- name: import distribution cert
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
- run: |
brew tap mitchellh/gon
brew install mitchellh/gon/gon
2022-11-03 21:51:22 +01:00
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
2023-08-11 17:19:22 +02:00
go-version: '>=1.21.0'
2022-11-03 21:51:22 +01:00
cache: true
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm install
working-directory: ui
- run: npm run build
working-directory: ui
env:
CI: "true"
2022-11-03 21:51:22 +01:00
- uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --skip-publish --config .goreleaser-darwin.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-11-08 17:08:17 +01:00
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
2022-11-03 21:51:22 +01:00
2022-11-03 21:52:34 +01:00
- uses: actions/upload-artifact@v3
2022-11-03 21:51:22 +01:00
with:
name: release-builds
path: ./dist/*.gz
2022-11-03 18:55:22 +01:00
build-windows:
runs-on: ubuntu-latest
steps:
- run: sudo apt update
2022-11-03 18:55:22 +01:00
- run: sudo apt-get install gcc-mingw-w64-x86-64
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
2023-08-11 17:19:22 +02:00
go-version: '>=1.21.0'
2022-11-03 18:55:22 +01:00
cache: true
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm install
working-directory: ui
- run: npm run build
working-directory: ui
env:
CI: "true"
2022-11-03 18:55:22 +01:00
- uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --skip-publish --config .goreleaser-windows.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-11-03 21:52:34 +01:00
- uses: actions/upload-artifact@v3
2022-11-03 18:55:22 +01:00
with:
2022-11-03 21:51:22 +01:00
name: release-builds
path: ./dist/*.gz
2022-11-03 18:55:22 +01:00
publish-release:
2023-02-08 17:40:27 +01:00
needs: [build-linux-amd64, build-linux-arm, build-linux-arm64, build-darwin, build-windows]
2022-11-03 18:55:22 +01:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
2022-11-03 21:51:22 +01:00
mkdir -p ./automated-release-build
2022-11-03 18:55:22 +01:00
- uses: actions/download-artifact@v3
with:
2022-11-03 21:51:22 +01:00
path: ./automated-release-build
2022-11-03 18:55:22 +01:00
- run: |
2022-11-03 21:51:22 +01:00
mv ./automated-release-build/release-builds/* ./automated-release-build/
rm -rf ./automated-release-build/release-builds
shasum ./automated-release-build/* > ./automated-release-build/checksums.txt
2022-11-03 18:55:22 +01:00
- uses: goreleaser/goreleaser-action@v3
with:
args: release --config .goreleaser-release.yml
env:
2023-02-08 17:40:27 +01:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}