Skip to content

ci: add workflow to build and release binary on tag #5

ci: add workflow to build and release binary on tag

ci: add workflow to build and release binary on tag #5

name: Build the binary and create release
on:
workflow_dispatch:
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'
cache-dependency-path: teamup-rocketchat-bot/go.sum
- 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 }} .
echo "binary created with filename $(ls build/)"
- name: Create GitHub release and upload binary
uses: softprops/action-gh-release@v2
with:
files: teamup-rocketchat-bot/build/linux-amd64-${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}