-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a release workflow triggered on a tag. (#635)
- Loading branch information
Showing
5 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
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
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,99 @@ | ||
name: Draft a Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
draft-a-release: | ||
name: Draft a Release | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
|
||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get Current Version | ||
id: current | ||
run: | | ||
echo version=$(yq .version spec/_info.yaml) >> "$GITHUB_OUTPUT" | ||
- name: Check Version | ||
run: | | ||
echo current=v${{ steps.current.outputs.version }} | ||
echo tag=${{ github.ref_name }} | ||
if "v${{ steps.current.outputs.version }}" != "${{ github.ref_name }}"; then | ||
echo "::error::Failing, reason: version ${{ steps.current.outputs.version }} does not match tag ${{ github.ref_name }}." | ||
exit 1 | ||
else | ||
echo "::notice::Found version ${{ steps.current.outputs.version }}, all good." | ||
fi | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Build | ||
run: npm ci && npm run merge | ||
|
||
- name: Upload Artifacts | ||
id: upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build | ||
path: | | ||
build/* | ||
- name: Extract Changelog | ||
id: changelog | ||
uses: sean0x42/markdown-extract@v2 | ||
with: | ||
file: CHANGELOG.md | ||
pattern: Unreleased | ||
no-print-matched-heading: true | ||
|
||
- name: Draft a release | ||
uses: softprops/action-gh-release@v2 | ||
id: release | ||
with: | ||
draft: true | ||
generate_release_notes: false | ||
tag_name: ${{ github.ref_name }} | ||
body: | | ||
${{ steps.changelog.outputs.markdown }} | ||
### Links | ||
- [Build Artifact](${{ steps.upload.outputs.artifact-url }}) | ||
files: | | ||
LICENSE.txt | ||
build/* | ||
- name: Increment Version | ||
uses: nguyenvukhang/semver-increment@v1 | ||
id: version | ||
with: | ||
increment: patch | ||
version-file: spec/_info.yaml | ||
version-regex: '^version: (.*)' | ||
|
||
- name: Update CHANGELOG to the Next Developer Iteration | ||
uses: thomaseizinger/keep-a-changelog-new-release@v3 | ||
with: | ||
tag: ${{ github.ref_name }} | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: 'Preparing for next developer iteration ${{ steps.version.outputs.version }}.' | ||
signoff: true | ||
branch: prepare-v-next | ||
base: main | ||
delete-branch: true | ||
title: 'Preparing for next developer iteration, ${{ steps.version.outputs.version }}.' | ||
body: | | ||
I've drafted a release, [${{ github.ref_name }}](${{ steps.release.outputs.url }}), please verify and release it. | ||
Preparing for the next developer iteration, ${{ steps.version.outputs.version }}. |
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
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,28 @@ | ||
- [Overview](#overview) | ||
- [Branching](#branching) | ||
- [Release Branching](#release-branching) | ||
- [Feature Branches](#feature-branches) | ||
- [Release Labels](#release-labels) | ||
- [Releasing](#releasing) | ||
|
||
## Overview | ||
|
||
This document explains the release strategy for opensearch-api-specification. | ||
|
||
## Versioning | ||
|
||
At this time this project follows minor semantic versioning, i.e. a breaking change is an increment from 0.1.0 to 0.2.0 and a non-breaking change is an increment from 0.1.0 to 0.1.1. A version 1.0 of the API specification will be released when the spec is known to be complete against any current version of OpenSearch. | ||
|
||
## Branching | ||
|
||
Given the early release stages of this repo we only maintain a **main** branch where all merges take place and code moves fast. | ||
|
||
# Releasing | ||
|
||
A release can be done by any [maintainer](MAINTAINERS.md). | ||
|
||
1. Check out the [upstream repo](https://github.com/opensearch-project/opensearch-api-specification) and ensure the repo is up-to-date with `git pull origin main` and that you do not have any local changes. | ||
2. Create a tag, e.g. `git tag v0.1.0`, and push it to GitHub with `git push origin --tags`. | ||
3. The [release workflow](.github/workflows/release.yml) will be automatically kicked off, a draft release, and a pull request that increments the version in [spec/_info.yaml](spec/_info.yaml) will be created. | ||
4. Verify and release the draft. | ||
5. Approve, and merge the version increment pull request. |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
$schema: ./json_schemas/_info.schema.yaml | ||
|
||
title: OpenSearch API Specification | ||
version: 1.0.0 | ||
version: 0.1.0 | ||
x-api-version: 2.16.0 |