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

Add GitHub Workflow to automate release generation #89

Merged
merged 9 commits into from
Jan 9, 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
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release
joanlopez marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
tags:
- v*

jobs:
checks:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Install dependencies
run: npm install
- name: Build & archive
run: |
set -x
VERSION="${GITHUB_REF##*/}"
npm run webpack && tar -zcf "k6-jslib-aws-${VERSION}.tar.gz" -C build .
- name: Create release with assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
VERSION="${GITHUB_REF##*/}"
gh release create "${VERSION}" "k6-jslib-aws-${VERSION}.tar.gz" "build/*" --target "${GITHUB_SHA}" --title "${VERSION}"
12 changes: 5 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,18 @@ In a PR:
1. Bump the version in the `package.json` file.
2. Run the `npm update` command to update the `package-lock.json` file.
3. Run the `npm run webpack` command to ensure the build system produces the latest distributable files.
4. Search and replace every occurences of the previous version in the `README.md` file with the new version.
5. Search and replace every occurences of the previous version in the `/examples` directory with the new version.
4. Search and replace every occurrence of the previous version in the `README.md` file with the new version.
5. Search and replace every occurrence of the previous version in the `/examples` directory with the new version.

### Create a tag and GitHub version

1. Tag the latest main branch's commit with the new version, following the [semantic versioning](https://semver.org/) convention, prefixed with a `v` character, as in: `v0.7.1`.
2. Create a dedicated GitHub version:
1. Pointing to the tag created above
2. Using the same name as the tag created above
3. Including the build files included in the commit tagged above
2. The [release.yml](.github/workflows/release.yml) workflow will automatically create a GitHub release with the new version.

### Publishing the new version

1. Open a PR on the [jslib repository](https://github.com/grafana/jslib.k6.io) using the `build/` directory files following the [new version instructions](https://github.com/grafana/jslib.k6.io#updating-a-version-of-a-js-package-listed-in-packagejson-dependencies).
1. Open a PR on the [jslib repository](https://github.com/grafana/jslib.k6.io) using the files from the [latest release](https://github.com/grafana/k6-jslib-aws/releases),
and following the [new version instructions](https://github.com/grafana/jslib.k6.io#updating-a-version-of-a-js-package-listed-in-packagejson-dependencies).
2. Make sure the k6 documentation website is updated to include the new version of the library:
1. The documented API should reflect the new version.
2. All the links to the library should point to the new version.
Loading