Skip to content

Commit

Permalink
Add GitHub Workflow to automate release generation (#89)
Browse files Browse the repository at this point in the history
* Set up release gh workflow

* Update CONTRIBUTING guide

* Change the artifact name
  • Loading branch information
joanlopez authored Jan 9, 2024
1 parent 1d00a06 commit 7bc5310
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
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

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.

0 comments on commit 7bc5310

Please sign in to comment.