Github Release #2
This file contains 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
name: GitHub Release | |
on: | |
workflow_run: | |
workflows: | |
- Lint Test Build | |
branches: | |
- master | |
types: | |
- completed | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19' | |
- name: Build binaries | |
run: | | |
mkdir -p dist | |
GOOS=linux GOARCH=amd64 go build -o dist/GoCrab-linux-amd64 . | |
GOOS=darwin GOARCH=amd64 go build -o dist/GoCrab-darwin-amd64 . | |
GOOS=windows GOARCH=amd64 go build -o dist/GoCrab-windows-amd64.exe . | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
run: | | |
docker build -t ghcr.io/${{ github.repository }}/gocrab:latest . | |
docker push ghcr.io/${{ github.repository }}/gocrab:latest |