build(make): add mkdev targets #109
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: CI/CD | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '**.md' | |
- 'docs/**' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- 'docs/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
release-please: | |
permissions: | |
contents: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
steps: | |
- name: Automate releases based on conventional commits | |
uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
config-file: configs/release-please-config.json | |
manifest-file: configs/release-please-manifest.json | |
- name: Format and print GH step summary | |
if: always() | |
run: | | |
echo "| Key | Value |" >> $GITHUB_STEP_SUMMARY | |
echo "|:--|:--|" >> $GITHUB_STEP_SUMMARY | |
echo "| **releases_created** | ${{ steps.release.outputs.releases_created }} |" >> $GITHUB_STEP_SUMMARY | |
echo "| **prs_created** | ${{ steps.release.outputs.prs_created }} |" >> $GITHUB_STEP_SUMMARY | |
- name: Format and print the release_created GH step summary | |
if: ${{ steps.release.outputs.release_created }} | |
run: | | |
echo "" >> $GITHUB_STEP_SUMMARY | |
echo "| Key | Value |" >> $GITHUB_STEP_SUMMARY | |
echo "|:--|:--|" >> $GITHUB_STEP_SUMMARY | |
echo "| **release_created** | ${{ steps.release.outputs.release_created }} |" >> $GITHUB_STEP_SUMMARY | |
echo "| **major** | ${{ steps.release.outputs.major }} |" >> $GITHUB_STEP_SUMMARY | |
echo "| **minor** | ${{ steps.release.outputs.minor }} |" >> $GITHUB_STEP_SUMMARY | |
echo "| **patch** | ${{ steps.release.outputs.patch }} |" >> $GITHUB_STEP_SUMMARY | |
echo "| **sha** | ${{ steps.release.outputs.sha }} |" >> $GITHUB_STEP_SUMMARY | |
lint-and-test: | |
needs: release-please | |
permissions: | |
contents: read | |
pull-requests: read | |
checks: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout default branch | |
uses: actions/checkout@v4 | |
- name: Run setup-go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 'stable' | |
cache: false | |
- name: Check files with golangci-lint | |
id: golangci | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: latest | |
- name: Test changes with go test | |
id: go-test | |
run: | | |
go test -cover ./internal/adapters/left/cli | |
- name: Format and print GH step summary | |
if: always() | |
run: | | |
echo "| Key | Value |" >> $GITHUB_STEP_SUMMARY | |
echo "|:--|:--|" >> $GITHUB_STEP_SUMMARY | |
echo "| **golangci-lint** | ${{ steps.golangci.outcome }} |" >> $GITHUB_STEP_SUMMARY | |
echo "| **go-test** | ${{ steps.go-test.outcome }} |" >> $GITHUB_STEP_SUMMARY | |
goreleaser: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
needs: [release-please, lint-and-test] | |
if: needs.release-please.outputs.release_created | |
steps: | |
- name: Checkout default branch | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Fetch tags | |
run: git fetch --force --tags | |
- name: Set up go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 'stable' | |
- name: Build and release with goreleaser | |
id: releaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean --config configs/goreleaser.yaml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Format and print GH step summary | |
if: always() | |
run: | | |
echo "| Key | Value |" >> $GITHUB_STEP_SUMMARY | |
echo "|:--|:--|" >> $GITHUB_STEP_SUMMARY | |
echo "| **goreleaser** | ${{ steps.releaser.outcome }} |" >> $GITHUB_STEP_SUMMARY | |
codeql-analyze: | |
permissions: | |
security-events: write | |
uses: ./.github/workflows/codeql.yaml |