Skip to content

Commit

Permalink
Update release and labeler workflows (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome authored Apr 28, 2023
1 parent 6a193a5 commit 8cc970b
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 96 deletions.
23 changes: 23 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
enhancement:
- head-branch: ['^feature/', '^feat/', '^enhancement/', '^enh/']

bug:
- head-branch: ['^fix/', '^bug/']

chore:
- head-branch: ['^chore/']

tests:
- any:
- head-branch: ['^tests/', '^test/']
- changed-files: ['tests/**/*']
- all:
- changed-files: ['!tests/requirements.txt']

documentation:
- head-branch: ['^docs/', '^doc/']
- changed-files: '**/*.md'

dependencies:
- head-branch: ['^deps/', '^dep/', '^dependabot/']
- changed-files: ['go.mod', 'go.sum']
74 changes: 0 additions & 74 deletions .github/release-drafter.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
changelog:
exclude:
labels:
- skip changelog
categories:
- title: 💣 Breaking Changes
labels:
- change
- title: 🚀 Features
labels:
- enhancement
- title: 🐛 Bug Fixes
labels:
- bug
- title: 🧪 Tests
labels:
- tests
- title: 🔨 Maintenance
labels:
- chore
- title: 📝 Documentation
labels:
- documentation
- title: ⬆️ Dependencies
labels:
- dependencies
- title: Other Changes
labels:
- "*"
26 changes: 20 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Golang Environment
uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache: true

- name: Determine GOPATH
id: go
run: echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT

- name: Build binary
uses: goreleaser/goreleaser-action@v4
with:
Expand All @@ -48,11 +51,13 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Golang Environment
uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache: true

- name: Run Tests
run: make test

Expand All @@ -65,23 +70,32 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Golang Environment
uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache: true

- name: Determine GOPATH
id: go
run: echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT
- name: Publish Release Notes
uses: release-drafter/release-drafter@v5

- name: Draft Release Notes
uses: lucacome/[email protected]
with:
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ startsWith(github.ref, 'refs/tags/') }}
minor-label: 'enhancement'
major-label: 'change'
publish: ${{ startsWith(github.ref, 'refs/tags/') }}
notes-footer: |
## Resources
- Documentation -- https://github.com/nginxinc/nginx-asg-sync/blob/{{version}}/README.md
if: github.event_name != 'pull_request'

- name: Download Syft
uses: anchore/sbom-action/[email protected]

- name: Build binaries
uses: goreleaser/goreleaser-action@v4
with:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Pull Request Labeler"
on:
- pull_request_target

permissions:
contents: read

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: joshdales/labeler@68a25980166b8ff8eb977d9a31cab5bd883793e1 # if https://github.com/actions/labeler/pull/203 is merged, use the official action actions/labeler
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
16 changes: 0 additions & 16 deletions .github/workflows/release-drafter.yml

This file was deleted.

0 comments on commit 8cc970b

Please sign in to comment.