-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Cache dependencies * Fix indentation and cache dependencies * Add action to bump version number * Formatting * Fix name * Rename * Add release workflow * Clean uo
- Loading branch information
Showing
6 changed files
with
833 additions
and
29 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,81 @@ | ||
# Bump Version | ||
|
||
A GitHub Action to bump a given version number. | ||
|
||
## Inputs | ||
|
||
```yaml | ||
inputs: | ||
current-version: | ||
description: The current semantic version number. | ||
required: true | ||
release-type: | ||
description: Type of release. Must be one of `patch` | `minor` | `major`. | ||
required: true | ||
``` | ||
## Outputs | ||
```yaml | ||
outputs: | ||
version: | ||
description: The new version number. | ||
``` | ||
## Example Usage | ||
```yaml | ||
name: Bump Version | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_type: | ||
description: Type of release | ||
type: choice | ||
required: true | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Git Checkout main | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get latest release version | ||
id: get_current_version | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const { data: { tag_name } } = await github.rest.repos.getLatestRelease({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo | ||
}) | ||
return tag_name | ||
- name: Bump version | ||
id: bump | ||
uses: ./.github/actions/bump-version | ||
with: | ||
bump-type: ${{ inputs.release_type }} | ||
version: ${{ steps.get_current_version.outputs.result }} | ||
|
||
- name: Push tag | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: 'refs/tags/${{ steps.bump.outputs.version }}', | ||
sha: context.sha | ||
}) | ||
``` | ||
## Acknowledgments | ||
Uses [semver-tool](https://github.com/fsaintjacques/semver-tool) |
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: Bump Version | ||
description: Bumps a given version number. | ||
|
||
inputs: | ||
current-version: | ||
description: The current semantic version number. | ||
required: true | ||
release-type: | ||
description: Type of release. Must be one of `patch` | `minor` | `major`. | ||
required: true | ||
|
||
outputs: | ||
version: | ||
description: The new version number. | ||
value: ${{ steps.bump.outputs.new-version }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Bump Version | ||
id: bump | ||
shell: bash | ||
run: | | ||
echo "new-version=$( ${{ github.action_path }}/semver.sh bump ${{ inputs.release-type }} ${{ inputs.current-version }} )" >> $GITHUB_OUTPUT |
Oops, something went wrong.