-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.87 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Release
on:
push:
tags:
- '*'
jobs:
build:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
asset_name: kubectl-config-doctor-linux-amd64.tar.gz
- os: windows-latest
target: x86_64-pc-windows-msvc
asset_name: kubectl-config-doctor-windows-amd64.zip
- os: macos-latest
target: aarch64-apple-darwin
asset_name: kubectl-config-doctor-darwin-arm64.tar.gz
- os: macos-latest
target: x86_64-apple-darwin
asset_name: kubectl-config-doctor-darwin-amd64.tar.gz
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build the project
run: cargo build --release --locked --target ${{ matrix.target }}
- name: Create tar.gz archive (Linux/macOS)
if: runner.os != 'Windows'
run: |
cp LICENSE target/${{ matrix.target }}/release/
tar -czvf ${{ matrix.asset_name }} -C target/${{ matrix.target }}/release kubectl-config-doctor LICENSE
- name: Create zip archive (Windows)
if: runner.os == 'Windows'
run: |
cp LICENSE target/${{ matrix.target }}/release/
Compress-Archive -Path target/${{ matrix.target }}/release/kubectl-config-doctor.exe, target/${{ matrix.target }}/release/LICENSE -DestinationPath ${{ matrix.asset_name }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
file: ${{ matrix.asset_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}