Skip to content

Commit

Permalink
feat: remove go-version input from release and prerelease
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The go-version input in the release and prerelease
actions no longer exists. Instead we will use the go version present in
the runner.
  • Loading branch information
tagoro9 committed Sep 16, 2024
1 parent 77594e4 commit f1c5f86
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
5 changes: 5 additions & 0 deletions docs/breaking-changes/v3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Breaking changes in v3

The `go-version` input in the `release` and `prerelease` actions no longer exists.

The action will use the installed version in the runner.
1 change: 0 additions & 1 deletion prerelease/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ GitHub Action that produces a new pre-release (snapshot) of a golang based repos
| `checkout-fetch-depth` | <p>The number of commits to fetch. 0 indicates all history for all branches and tags</p> | `false` | `0` |
| `create-prerelease` | <p>Whether semantic-release should create a prerelease or do a dry run. This can be useful to set to true when a prerelease requires pushing artifacts semantic-release is in charge of generating</p> | `false` | `false` |
| `github-token` | <p>GitHub token that can checkout the consumer repository as well as create tags/releases against it. e.g. 'secrets.GITHUB_TOKEN'</p> | `true` | `""` |
| `go-version` | <p>Go version to use for building</p> | `true` | `1.17.3` |
| `push-docker-snapshot` | <p>If a docker snapshot image is generated, push it to the to the registry</p> | `false` | `false` |
| `docker-username` | <p>Docker username to push the snapshot image to the registry</p> | `false` | `""` |
| `docker-password` | <p>Docker password to push the snapshot image to the registry</p> | `false` | `""` |
Expand Down
10 changes: 5 additions & 5 deletions prerelease/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ inputs:
github-token:
description: GitHub token that can checkout the consumer repository as well as create tags/releases against it. e.g. 'secrets.GITHUB_TOKEN'
required: true
go-version:
description: Go version to use for building
required: true
default: 1.17.3
# TODO Could this be replaced by create-prerelease + the presence of the docker credentials?
push-docker-snapshot:
description: If a docker snapshot image is generated, push it to the to the registry
Expand Down Expand Up @@ -132,11 +128,15 @@ runs:
echo "version=${{ steps.prerelease.outputs.new-release-version }}" >> $GITHUB_OUTPUT
echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> "$GITHUB_OUTPUT"
- name: Set Go Version
shell: bash
run: |
echo "GOVERSION=$(< .go-version tr -d '\n')" >> $GITHUB_ENV
- name: Goreleaser
uses: goreleaser/goreleaser-action@v6
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
GOVERSION: ${{ inputs.go-version }}
with:
args: release

Expand Down
7 changes: 0 additions & 7 deletions release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ GitHub Action that produces a new Release of a golang based repository.
| `checkout-repo` | <p>Perform checkout as first step of action</p> | `false` | `true` |
| `checkout-fetch-depth` | <p>The number of commits to fetch. 0 indicates all history for all branches and tags</p> | `false` | `0` |
| `github-token` | <p>GitHub token that can checkout the consumer repository as well as create tags/releases against it. e.g. 'secrets.GITHUB_TOKEN'</p> | `true` | `""` |
| `go-version` | <p>Go version to use for building</p> | `true` | `1.17.3` |
| `dry-run` | <p>Whether to run semantic release in <code>dry-run</code> mode. It will override the <code>dryRun</code> attribute in your configuration file</p> | `false` | `false` |
| `extra-plugins` | <p>Extra plugins for pre-install. You can also specify specifying version range for the extra plugins if you prefer. Defaults to install @open-turo/semantic-release-config.</p> | `false` | `@open-turo/semantic-release-config ` |
<!-- action-docs-inputs source="action.yaml" -->
Expand Down Expand Up @@ -82,12 +81,6 @@ This action is a `composite` action.
# Required: true
# Default: ""

go-version:
# Go version to use for building
#
# Required: true
# Default: 1.17.3

dry-run:
# Whether to run semantic release in `dry-run` mode. It will override the `dryRun` attribute in your configuration file
#
Expand Down
6 changes: 0 additions & 6 deletions release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ inputs:
github-token:
description: GitHub token that can checkout the consumer repository as well as create tags/releases against it. e.g. 'secrets.GITHUB_TOKEN'
required: true
go-version:
description: Go version to use for building
required: true
default: 1.17.3
dry-run:
required: false
description: Whether to run semantic release in `dry-run` mode. It will override the `dryRun` attribute in your configuration file
Expand Down Expand Up @@ -85,8 +81,6 @@ runs:
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
GOPRIVATE: github.com/turo/
# TODO Read this from the .go-version file instead
GOVERSION: ${{ inputs.go-version }}
# TODO Handle the prerelease value? How can we get this out of the semantic-release output?
# This is done in the goreleaser config file with the prerelease: auto option
with:
Expand Down

0 comments on commit f1c5f86

Please sign in to comment.