Files
casecmp/.github/workflows/ci.yml

61 lines
1.8 KiB
YAML

---
name: CI
on: [push]
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Install dependencies
run: go mod download
- name: Build binary
run: make
- name: Run and make request
run: |
./bin/casecmp --port=8080 &
curl --silent --retry 10 --retry-delay 1 --retry-connrefused \
http://localhost:8080/
release:
runs-on: ubuntu-latest
needs: [build]
if: github.ref == 'refs/heads/main'
steps:
- uses: google-github-actions/release-please-action@v3
id: release-please
with:
command: manifest
- if: ${{ steps.release-please.outputs.release_created }}
uses: actions/checkout@v3
with:
fetch-depth: 0
- if: ${{ steps.release-please.outputs.release_created }}
name: Set up QEMU
uses: docker/setup-qemu-action@v2
- if: ${{ steps.release-please.outputs.release_created }}
uses: docker/setup-buildx-action@v2
- if: ${{ steps.release-please.outputs.release_created }}
name: Docker Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- if: ${{ steps.release-please.outputs.release_created }}
uses: actions/setup-go@v3
with:
go-version: 1.19
- if: ${{ steps.release-please.outputs.release_created }}
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}