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

chore(ci): convert to a push-button release workflow #725

Merged
merged 1 commit into from
Jul 10, 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
27 changes: 12 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
# This GitHub action can publish assets for release when a tag is created.
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
#
# This uses an action (paultyng/ghaction-import-gpg) that assumes you set your
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
# secret. If you would rather own your own GPG handling, please fork this action
# or use an alternative one for key handling.
#
# You will need to pass the `--batch` flag to `gpg` in your signing step
# in `goreleaser` to indicate this is being used in a non-interactive mode.
#
name: release
name: Generate Next Release
on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -42,6 +28,17 @@ jobs:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}

- name: Release
uses: cycjimmy/semantic-release-action@v3
with:
semantic_version: 19.0.5
extra_plugins: |
@semantic-release/exec@6.0.3
@semantic-release/git@10.0.0
conventional-changelog-conventionalcommits@4.6.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
Expand Down
3 changes: 1 addition & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ signs:
- "--detach-sign"
- "${artifact}"
release:
# If you want to manually examine the release before its live, uncomment this line:
# draft: true
mode: "keep-existing"
changelog:
disable: true
37 changes: 37 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"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/git",
{
"message": "ci: regenerate code for version ${nextRelease.version}",
"assets": [
"."
]
}
]
]
}
22 changes: 22 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Release Instructions

These build and release instructions are intended for the maintainers and future maintainers of this project.

## Preparing a new version

There are no preparation steps.

* the version is computed from [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) tags
* There is no changelog; the GitHub release notes are generated based on [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) tags

## Releasing

Run the GitHub Actions [Release Workflow](.github/workflows/release.yml) on the `main` branch.

The release workflow:
- Uses [Semantic Release](.releaserc.json) to determine the next version number and create the GitHub release
- Uses [GoReleaser](.goreleaser.yml) to build the terraform provider plugins and attach them to the GitHub release

This will build and release plugins for several different OS and Architecture combinations.

Any special instructions or notes should be added by editing the release notes that the workflow publishes. These notes can be found at https://github.com/equinix/terraform-provider-equinix/releases
Loading