Skip to content

Go Build and Release #4

Go Build and Release

Go Build and Release #4

Workflow file for this run

# This workflow will build a Go project manually and create a release
name: Go Build and Release
on:
workflow_dispatch: # Permet d'exécuter manuellement le workflow
inputs:
version:
description: "Version of the release"
required: true
default: "1.0.0-alpha"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: update packages
run: |
go mod tidy
- name: Build Binary 1
run: |
CGO_ENABLED=0 go build -o oCameraAgent -ldflags="-s -w" -buildvcs=false
- name: Build Binary 2
run: |
CGO_ENABLED=0 GOARCH=arm go build -o oCameraAgent.arm -ldflags="-s -w" -buildvcs=false
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: v${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
draft: true
prerelease: true
body: "Release version ${{ github.event.inputs.version }}"
- name: Upload Build 1 to Release
uses: actions/upload-release-asset@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
release_id: ${{ steps.create_release.outputs.id }}
asset_path: ./oCameraAgent
asset_name: oCameraAgent
asset_content_type: application/octet-stream
- name: Upload Build 2 to Release
uses: actions/upload-release-asset@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
release_id: ${{ steps.create_release.outputs.id }}
asset_path: ./oCameraAgent.arm
asset_name: oCameraAgent.arm
asset_content_type: application/octet-stream