Skip to content

v3.0.0

v3.0.0 #20

Workflow file for this run

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 }}