Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

feat(BUX-144,146): auto-relase github action #5

Merged
merged 6 commits into from
Aug 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
33 changes: 33 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: bump-version
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: release-please
id: release
uses: GoogleCloudPlatform/release-please-action@v3
with:
token: ${{ secrets.TOKEN }}
release-type: go

- name: merge-pr
if: steps.release.outputs.pr
uses: actions/github-script@v6
with:
github-token: ${{ secrets.TOKEN }}
script: |
const pr = ${{ steps.release.outputs.pr }};
if (pr && pr.number) {
github.rest.pulls.merge({
pull_number: pr.number,
owner: context.repo.owner,
repo: context.repo.repo
});
}
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: release

on:
push:
tags:
- '*'

jobs:
syndicate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Task
run: |
curl -sL https://taskfile.dev/install.sh | sh
sudo mv ./bin/task /usr/local/bin
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Sync with GoDocs using Taskfile
run: task godocs
env:
GIT_DOMAIN: ${{ github.server_url }}
REPO: ${{ github.repository }}
VERSION_SHORT: ${{ github.ref }}
24 changes: 24 additions & 0 deletions .github/workflows/test-and-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Run Tests and Lint

on: push

jobs:
test-and-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Install Task
run: |
curl -sL https://taskfile.dev/install.sh | sh
sudo mv ./bin/task /usr/local/bin
- name: Run Tests
run: task test
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v2
- name: Run Lint
run: task lint
21 changes: 21 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3'

tasks:
test:
desc: Run tests
cmds:
- go test ./...

lint:
desc: Run lint
cmds:
- golangci-lint run

godocs:
desc: Sync the latest tag with GoDocs
cmds:
- echo "syndicating to GoDocs..."
- test $(GIT_DOMAIN)
- test $(REPO)
- test $(VERSION_SHORT)
- curl https://proxy.golang.org/$(GIT_DOMAIN)/$(REPO)/@v/$(VERSION_SHORT).info
Loading