Update go.yml #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Go | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # release changes require contents write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- name: Build | |
run: | | |
go build -o tg_faka_linux cmd/main.go | |
- name: List root directory contents | |
run: ls -al / | |
- name: Install GitHub CLI | |
run: sudo apt-get install -y gh | |
- name: Authenticate GitHub CLI | |
run: gh auth login --with-token <<< ${{ secrets.GITHUB_TOKEN }} | |
- name: Compress build output and .env folder | |
run: | | |
zip -r tg_faka_linux.zip tg_faka_linux .env | |
- name: Upload Release Asset | |
run: | | |
gh release upload release tg_faka_linux.zip --clobber | |