-
Notifications
You must be signed in to change notification settings - Fork 54
42 lines (40 loc) · 2.22 KB
/
assets.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
name: Upload assets to release
on:
release:
types: [published]
jobs:
upload_assets:
runs-on: ubuntu-latest
steps:
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Build and pack for linux-amd64
run: GOOS=linux GOARCH=amd64 go build -o nmap-formatter && tar -czvf nmap-formatter-linux-amd64.tar.gz nmap-formatter
- name: Build and pack for linux-arm64
run: GOOS=linux GOARCH=arm64 go build -o nmap-formatter && tar -czvf nmap-formatter-linux-arm64.tar.gz nmap-formatter
- name: Build and pack for windows-amd64
run: GOOS=windows GOARCH=amd64 go build -o nmap-formatter.exe && zip nmap-formatter-windows-amd64.zip nmap-formatter.exe
- name: Build and pack for windows-arm64
run: GOOS=windows GOARCH=arm64 go build -o nmap-formatter.exe && zip nmap-formatter-windows-arm64.zip nmap-formatter.exe
- name: Build and pack for macos-amd64
run: GOOS=darwin GOARCH=amd64 go build -o nmap-formatter && zip nmap-formatter-darwin-amd64.zip nmap-formatter
- name: Build and pack for macos-arm64
run: GOOS=darwin GOARCH=arm64 go build -o nmap-formatter && zip nmap-formatter-darwin-arm64.zip nmap-formatter
- name: Upload release files
if: startsWith(github.ref, 'refs/tags/')
run: |
gh release upload ${{ steps.get_version.outputs.VERSION }} nmap-formatter-linux-amd64.tar.gz --clobber
gh release upload ${{ steps.get_version.outputs.VERSION }} nmap-formatter-windows-amd64.zip --clobber
gh release upload ${{ steps.get_version.outputs.VERSION }} nmap-formatter-darwin-amd64.zip --clobber
gh release upload ${{ steps.get_version.outputs.VERSION }} nmap-formatter-linux-arm64.tar.gz --clobber
gh release upload ${{ steps.get_version.outputs.VERSION }} nmap-formatter-windows-arm64.zip --clobber
gh release upload ${{ steps.get_version.outputs.VERSION }} nmap-formatter-darwin-arm64.zip --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}