Skip to content

CI: Add workflow to build and release binary on tag #2

CI: Add workflow to build and release binary on tag

CI: Add workflow to build and release binary on tag #2

name: Build the binary and create release
on:
workflow_dispatch:
pull_request:
push:
tags:
- '**'
jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build the binary for linux/amd64
working-directory: teamup-rocketchat-bot
# run: GOARCH=amd64 GOOS=linux go build -o build/linux-amd64-${{ github.ref_name }} .
run: GOARCH=amd64 GOOS=linux go build -o build/linux-amd64 .
- name: Create GitHub release and upload binary
uses: softprops/action-gh-release@v2
with:
# files: teamup-rocketchat-bot/build/linux-amd64-${{ github.ref_name }}
files: teamup-rocketchat-bot/build/linux-amd64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}