Skip to content

Commit

Permalink
Merge pull request #3 from enthus-golang/fk_workflow
Browse files Browse the repository at this point in the history
Updated workflows
  • Loading branch information
Mugetsu35 authored Jan 30, 2025
2 parents 9ff3943 + ef6cc80 commit 908ab7e
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 37 deletions.
8 changes: 2 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
reviewers:
- "Fank"
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
reviewers:
- "Fank"
interval: "weekly"
5 changes: 5 additions & 0 deletions .github/templates/go-licenses.md.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## [go-licenses](https://github.com/google/go-licenses) report

{{- range . }}
- {{ .Name }} ({{ .Version }}) [{{ .LicenseName }}]({{ .LicenseURL }})
{{- end }}
33 changes: 33 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
tags:
- 'v*.*.*' # Trigger on version tags like v1.0.0, v2.1.0, etc.

permissions:
contents: write

jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Git
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
- name: Generate Changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v5

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changelog }} # Attach changelog
33 changes: 2 additions & 31 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:

jobs:
golangci:
name: lint
name: Go Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -34,11 +34,10 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest

test:
runs-on: ubuntu-latest
name: Go Test
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -63,31 +62,3 @@ jobs:
uses: robherley/go-test-action@v0
with:
testArguments: ./...

license-check:
runs-on: ubuntu-latest
name: License Check
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod

- name: Install go-licenses
run: go install github.com/google/go-licenses@latest
shell: bash

- name: Check licenses
run: >
go-licenses check ./...
--ignore ${{ github.repository }}
shell: bash

- name: Get licenses list
run: >
go-licenses csv ./...
--ignore ${{ github.repository }}
shell: bash
49 changes: 49 additions & 0 deletions .github/workflows/license_go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: License Go

on:
push:
branches:
- main
- master
pull_request:

jobs:
license-check:
runs-on: ubuntu-latest
name: License Check
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod

- name: Install go-licenses
run: go install github.com/google/go-licenses@latest

- name: Check licenses
run: go-licenses check ./...

license-report:
runs-on: ubuntu-latest
name: License Report
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod

- name: Install go-licenses
run: go install github.com/google/go-licenses@latest

- name: Report to GitHub Step Summary
run: >
go-licenses report ./...
--template .github/templates/go-licenses.md.tpl
>> $GITHUB_STEP_SUMMARY
shell: bash

0 comments on commit 908ab7e

Please sign in to comment.