Skip to content

toughradius release

toughradius release #1

Workflow file for this run

name: toughradius release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build and Release
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
- name: Check out code
uses: actions/checkout@v3
# Build for ARM64
- name: Build for ARM64
run: |
mkdir -p ./release
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -ldflags '-s -w -extldflags "-static"' -o ./release/toughradius_arm64 main.go
# Build for AMD64
- name: Build for AMD64
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-s -w -extldflags "-static"' -o ./release/toughradius_amd64 main.go
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
# Upload ARM64 Asset
- name: Upload Release Asset for ARM64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/toughradius_arm64
asset_name: toughradius_arm64
asset_content_type: application/octet-stream
# Upload AMD64 Asset
- name: Upload Release Asset for AMD64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/toughradius_amd64
asset_name: toughradius_amd64
asset_content_type: application/octet-stream