Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f070e091bc | ||
|
|
bf52dcb0f1 | ||
|
|
72d90beb74 | ||
|
|
95516055b3 | ||
|
|
d5f1a25f77 | ||
|
|
d278e42d43 | ||
|
|
14747e0edd | ||
|
|
9f29266402 | ||
|
|
5d0b3111f2 |
73
.github/workflows/release.yml
vendored
Normal file
73
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
bump:
|
||||||
|
description: Version bump type
|
||||||
|
required: true
|
||||||
|
default: patch
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- patch
|
||||||
|
- minor
|
||||||
|
- major
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-slim
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Determine new version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
# Get the latest semver tag
|
||||||
|
LATEST_TAG=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | head -n1)
|
||||||
|
if [ -z "$LATEST_TAG" ]; then
|
||||||
|
echo "No existing version tag found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Strip leading 'v' and split into components
|
||||||
|
VERSION="${LATEST_TAG#v}"
|
||||||
|
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
|
||||||
|
|
||||||
|
case "${{ inputs.bump }}" in
|
||||||
|
major)
|
||||||
|
MAJOR=$((MAJOR + 1))
|
||||||
|
MINOR=0
|
||||||
|
PATCH=0
|
||||||
|
;;
|
||||||
|
minor)
|
||||||
|
MINOR=$((MINOR + 1))
|
||||||
|
PATCH=0
|
||||||
|
;;
|
||||||
|
patch)
|
||||||
|
PATCH=$((PATCH + 1))
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
NEW_VERSION="v${MAJOR}.${MINOR}.${PATCH}"
|
||||||
|
echo "previous=$LATEST_TAG" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "new=$NEW_VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "major=v${MAJOR}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "Bumping $LATEST_TAG -> $NEW_VERSION"
|
||||||
|
|
||||||
|
- name: Create GitHub release
|
||||||
|
run: |
|
||||||
|
gh release create "${{ steps.version.outputs.new }}" \
|
||||||
|
--generate-notes \
|
||||||
|
--notes-start-tag "${{ steps.version.outputs.previous }}"
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Update major version tag
|
||||||
|
run: |
|
||||||
|
git fetch origin tag "${{ steps.version.outputs.new }}"
|
||||||
|
git tag -f "${{ steps.version.outputs.major }}" "${{ steps.version.outputs.new }}"
|
||||||
|
git push -f origin "${{ steps.version.outputs.major }}"
|
||||||
@@ -6,7 +6,7 @@ A GitHub Action to install the [GitHub Copilot CLI](https://github.com/github/co
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-copilot@v1
|
- uses: actions/setup-copilot@v0
|
||||||
with:
|
with:
|
||||||
version: "latest" # optional, defaults to "latest"
|
version: "latest" # optional, defaults to "latest"
|
||||||
github-token: ${{ secrets.COPILOT_TOKEN }} # optional, defaults to github.token
|
github-token: ${{ secrets.COPILOT_TOKEN }} # optional, defaults to github.token
|
||||||
@@ -31,13 +31,13 @@ steps:
|
|||||||
### Install latest version
|
### Install latest version
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/setup-copilot@v1
|
- uses: actions/setup-copilot@v0
|
||||||
```
|
```
|
||||||
|
|
||||||
### Install a specific version
|
### Install a specific version
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/setup-copilot@v1
|
- uses: actions/setup-copilot@v0
|
||||||
with:
|
with:
|
||||||
version: "1.2.3"
|
version: "1.2.3"
|
||||||
```
|
```
|
||||||
@@ -45,7 +45,7 @@ steps:
|
|||||||
### Use with a custom token
|
### Use with a custom token
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/setup-copilot@v1
|
- uses: actions/setup-copilot@v0
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GH_TOKEN }}
|
github-token: ${{ secrets.GH_TOKEN }}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -27,9 +27,8 @@ runs:
|
|||||||
env:
|
env:
|
||||||
VERSION: ${{ inputs.version }}
|
VERSION: ${{ inputs.version }}
|
||||||
PREFIX: ${{ runner.tool_cache }}/copilot
|
PREFIX: ${{ runner.tool_cache }}/copilot
|
||||||
run: curl -fsSL https://gh.io/copilot-install | bash
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ inputs.github-token }}
|
GITHUB_TOKEN: ${{ inputs.github-token }}
|
||||||
|
run: curl -fsSL https://gh.io/copilot-install | bash
|
||||||
|
|
||||||
- name: Add to PATH
|
- name: Add to PATH
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
Reference in New Issue
Block a user