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

Commit

Permalink
feat: add a push-button release workflow
Browse files Browse the repository at this point in the history
This adds a manually-triggered GitHub Actions workflow that will
look at the commits on the `main` branch since the last release
and determine the correct semantic version bump, regenerate the
client code to include the correct version in the User Agent and
docs, and create a GitHub release with the appropriate release
notes generated from the commit messages since the last release.
  • Loading branch information
ctreatma committed May 9, 2023
1 parent 8939d3d commit e91af00
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 3 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: generate-release
# This workflow will generate changelog and release notes.
# Source: https://github.com/terraform-aws-modules/terraform-aws-vpc/blob/master/.github/workflows/release.yml

on:
workflow_dispatch:

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: Release
uses: cycjimmy/[email protected]
with:
semantic_version: 19.0.5
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_AUTHOR_NAME: equinix-labs@auto-commit-workflow
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: equinix-labs@auto-commit-workflow
GIT_COMMITTER_EMAIL: [email protected]
41 changes: 41 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"branches": [
"main"
],
"ci": false,
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/github",
{
"successComment": "This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:",
"labels": false,
"releasedLabels": false
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "echo -n '${nextRelease.version}' > version && make clean gen mod docs move-other patch-post fmt"
}
],
[
"@semantic-release/git",
{
"message": "ci: regenerate code for version ${nextRelease.version}",
"assets": ["."]
}
]
]
}
2 changes: 1 addition & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ To exclude resources, and optimize response delivery, use the `exclude` query pa
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.

- API version: 1.0.0
- Package version: 0.7.0
- Package version: 0.8.1
- Build package: org.openapitools.codegen.languages.GoClientCodegen

## Installation
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GIT_ORG=equinix-labs
GIT_REPO=metal-go
PACKAGE_PREFIX=metal
PACKAGE_MAJOR=v1
PACKAGE_VERSION=0.7.0
PACKAGE_VERSION=$(shell cat version)
CRI=docker # nerdctl

OPENAPI_GENERATOR=${CRI} run --rm -u ${CURRENT_UID}:${CURRENT_GID} -v $(CURDIR):/local ${OPENAPI_IMAGE}
Expand Down
2 changes: 1 addition & 1 deletion metal/v1/configuration.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.8.1

0 comments on commit e91af00

Please sign in to comment.