CI #1
Workflow file for this run
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
| name: CI | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| Binary: | |
| description: 'Build binary' | |
| default: true | |
| type: boolean | |
| Version: | |
| description: 'Version for binary' | |
| required: true | |
| default: 'latest' | |
| type: string | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone main repository | |
| uses: actions/checkout@v4 | |
| - name: Install Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: 1.23 | |
| - name: Build binaries | |
| if: ${{ github.event.inputs.Binary == 'true' }} | |
| run: | | |
| mkdir -p bin | |
| architectures=("amd64" "arm64") | |
| for arch in "${architectures[@]}"; do | |
| GOOS=windows GOARCH=$arch go build -o bin/ssh-bot-${{ github.event.inputs.Version }}-windows-$arch.exe main.go | |
| GOOS=linux GOARCH=$arch go build -o bin/ssh-bot-${{ github.event.inputs.Version }}-linux-$arch main.go | |
| # GOOS=darwin GOARCH=$arch go build -o bin/ssh-bot-${{ github.event.inputs.Version }}-darwin-$arch main.go | |
| done | |
| ls -lh bin | |
| mkdir -p bin/ssh-bot-linux bin/ssh-bot-windows bin/ssh-bot-raspberry-pi | |
| mv bin/ssh-bot-${{ github.event.inputs.Version }}-windows-amd64 bin/ssh-bot-windows/ssh-bot.exe | |
| cp .env.example bin/ssh-bot-windows/.env | |
| mv bin/ssh-bot-${{ github.event.inputs.Version }}-linux-amd64 bin/ssh-bot-linux/ssh-bot | |
| cp .env.example bin/ssh-bot-linux/.env | |
| mv bin/ssh-bot-${{ github.event.inputs.Version }}-linux-arm64 bin/ssh-bot-raspberry-pi/ssh-bot | |
| cp .env.example bin/ssh-bot-raspberry-pi/.env | |
| ls -lh bin/* | |
| - name: Upload binaries for Windows | |
| if: ${{ github.event.inputs.Binary == 'true' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ssh-bot-windows-${{ github.event.inputs.Version }} | |
| path: bin/ssh-bot-windows | |
| - name: Upload binaries for Linux | |
| if: ${{ github.event.inputs.Binary == 'true' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ssh-bot-linux-${{ github.event.inputs.Version }} | |
| path: bin/ssh-bot-linux | |
| - name: Upload binaries for Raspberry Pi | |
| if: ${{ github.event.inputs.Binary == 'true' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ssh-bot-raspberry-pi-${{ github.event.inputs.Version }} | |
| path: bin/ssh-bot-raspberry-pi |