This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(BUX-144,146): auto-relase github action (#5)
* feat: auto-relase github action * feat: renames action * feat: release process * feat: replaces secrets with info retrieved from github context * fix: replaces reponame with whole repo context object * feat: replaces variable name
- Loading branch information
Showing
4 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |