Skip to content
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

fix/ci cd #1197

Merged
merged 5 commits into from
Dec 19, 2024
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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
interval: "monthly"
43 changes: 37 additions & 6 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,23 @@ name: Run All Checks

on:
pull_request:
types: [opened, edited, closed]
merge_group:

jobs:
tidy-pr:
name: Tidy PR
if: github.event_name == 'pull_request'
permissions:
contents: read # for TimonVS/pr-labeler-action to read config file
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
runs-on: ubuntu-latest
steps:
- uses: TimonVS/pr-labeler-action@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value

test-builds:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -83,10 +97,10 @@ jobs:
check-latest: true
- run: make test-cover

goreleaser-check:
validate-release:
if: github.event_name == 'merge_group'
runs-on: ubuntu-latest
name: Check GoReleaser Config
name: Verify Release Config
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -103,19 +117,36 @@ jobs:
- name: Check GoReleaser Config
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
distribution: goreleaser
version: latest
args: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

- name: GoReleaser Dry Run
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser-pro
distribution: goreleaser
version: latest
args: release --snapshot --clean --skip=publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

bump-version:
if: github.event_name == 'merge_group'
runs-on: ubuntu-latest
name: Bump Current Version
needs: [validate-release, test-cover, test-race]
outputs:
new_tag: ${{ steps.bump.outputs.new_tag }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Create bump and changelog
id: bump
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
increment: "PATCH"
34 changes: 0 additions & 34 deletions .github/workflows/deploy-net.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/label-pr.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/publish-assets.yml

This file was deleted.

26 changes: 22 additions & 4 deletions .github/workflows/make-docs.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
name: Publish Docs via GitHub Pages
name: Publish Versioned Assets
on:
push:
branches:
- main
- master
- develop
- main
paths:
- "docs/**"
- "proto/**"

permissions:
contents: write
issues: write

jobs:
deploy:
buf_push:
name: Publish to buf.build/onsonr/sonr
runs-on: ubuntu-latest
steps:
# Run `git checkout`
- uses: actions/checkout@v4
# Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1
# Push only the Input in `proto` to the BSR
- uses: bufbuild/buf-push-action@v1
continue-on-error: true
with:
input: proto
buf_token: ${{ secrets.BUF_TOKEN }}

publish-docs:
runs-on: ubuntu-latest
name: Publish Docs
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Versioned Release

on:
push:
tags:
- v*

permissions:
contents: write

jobs:
new-release:
name: Run GoReleaser on New Tag
if: startsWith(github.ref, 'refs/tags/')
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true

- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Release
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASER_TOKEN }}
GITHUB_PERSONAL_AUTH_TOKEN: ${{ secrets.GH_RELEASER_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
95 changes: 0 additions & 95 deletions .github/workflows/scheduled-release.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/version-bump.yml

This file was deleted.

Loading