Skip to content

Commit

Permalink
👷 add release ci
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvain-reynaud committed Apr 24, 2023
1 parent 53bb4f7 commit 2f31b4c
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
template: |
## What Changed
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
categories:
- title: Features
labels:
- "type: feat"
- title: Fixes
labels:
- "type: fix"
- title: Documentation
labels:
- "type: docs"
- title: CI
labels:
- "type: ci"
- title: Dependency Updates
labels:
- "type: build"
- title: Refactor
labels:
- "type: refactor"
collapse-after: 5

change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&'
version-resolver:
major:
labels:
- major
minor:
labels:
- minor
patch:
labels:
- patch
default: patch

exclude-labels:
- skip-changelog
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: GO CI
on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: "1.20"

- name: Build
run: go build -v -o gateway *.go

# - name: Test
# run: go test -v ./...

release-drafter:
needs: build
runs-on: ubuntu-22.04
steps:
- name: Release Drafter
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/label-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Label Checker
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
check_semantic_release_label:
name: Check for semantic version label
runs-on: ubuntu-latest
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest
with:
one_of: major,minor,patch,skip-changelog
repo_token: ${{ secrets.GITHUB_TOKEN }}

check_labels:
name: Check labels
runs-on: ubuntu-latest
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest
with:
any_of: documentation,enhancement,feature,fix,chore
none_of: invalid,wontfix,duplicate,question,bug
repo_token: ${{ secrets.GITHUB_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release
on:
release:
types:
- published

jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: "1.20"

# - name: Test
# run: go test -v ./...

release:
strategy:
matrix:
goarch: ["amd64", "arm64"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Build
uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: linux
goarch: ${{ matrix.goarch }}
goversion: "1.20"
binary_name: gateway
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ func main() {
}
log.SetLevel(level)

// Run the registry HTTP server
gw, err := gateway.NewServer()
if err != nil {
log.Fatalf("failed to initialize the gateway: %v", err)
Expand Down

0 comments on commit 2f31b4c

Please sign in to comment.