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

Commit

Permalink
feat(BUX-144,146): auto-relase github action (#5)
Browse files Browse the repository at this point in the history
* 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
wregulski authored Aug 28, 2023
1 parent 75a9017 commit 174d5e1
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 0 deletions.
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

0 comments on commit 174d5e1

Please sign in to comment.