Skip to content

Update release and labeler workflows #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/draft-release@v0.2.0
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/download-syft@v0.14.1

- 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.