From 947e3826ca7412d16942c700515c7491aa812127 Mon Sep 17 00:00:00 2001 From: Cailyn Sinclair Date: Sun, 14 Dec 2025 22:46:19 -0800 Subject: [PATCH 1/3] Releasing v1.1.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dc68952..0b03f81 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wca/helpers", - "version": "1.1.5", + "version": "1.1.2", "description": "Helpers and class definitions for WCA and WCIF", "keywords": [ "wca", From 16d1b33e54e53e8316278cba6d186c3ab8733a54 Mon Sep 17 00:00:00 2001 From: Cailyn Sinclair Date: Sun, 14 Dec 2025 22:31:23 -0800 Subject: [PATCH 2/3] 1.1.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0b03f81..8e3298e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wca/helpers", - "version": "1.1.2", + "version": "1.1.6", "description": "Helpers and class definitions for WCA and WCIF", "keywords": [ "wca", From 55815e425e6261ee4507829ef80ab0e66f9a56ed Mon Sep 17 00:00:00 2001 From: Cailyn Sinclair Date: Sun, 14 Dec 2025 22:44:01 -0800 Subject: [PATCH 3/3] Automatically publish new versions from PRs --- .github/workflows/release.yml | 81 +++++++++++++++++++++++++++++++++++ README.md | 21 +++++++-- 2 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c3db5a3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,81 @@ +name: Release + +on: + push: + branches: + - master + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: https://registry.npmjs.org + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Build package + run: npm run build + + - name: Read package version + id: pkg + run: echo "version=$(node -p \"require('./package.json').version\")" >> "$GITHUB_OUTPUT" + + - name: Check published version + id: published + run: | + PUBLISHED=$(npm view @wca/helpers version || echo "none") + echo "version=$PUBLISHED" >> "$GITHUB_OUTPUT" + + - name: Create tag from package version + id: create_tag + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const version = '${{ steps.pkg.outputs.version }}'; + const tag = `v${version}`; + const { owner, repo } = context.repo; + + try { + await github.rest.git.getRef({ owner, repo, ref: `tags/${tag}` }); + core.info(`Tag ${tag} already exists, skipping creation.`); + core.setOutput('created', 'false'); + return; + } catch (error) { + if (error.status !== 404) throw error; + } + + await github.rest.git.createRef({ + owner, + repo, + ref: `refs/tags/${tag}`, + sha: context.sha, + }); + core.info(`Created tag ${tag}.`); + core.setOutput('created', 'true'); + + - name: Publish to npm + if: steps.pkg.outputs.version != steps.published.outputs.version + run: npm publish --access public --provenance + + - name: Create GitHub release + if: steps.create_tag.outputs.created == 'true' + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ steps.pkg.outputs.version }} + generate_release_notes: true diff --git a/README.md b/README.md index 68e0804..a225107 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# WCA Helpers +\*\*\*\*# WCA Helpers > Helpers and class definitions for WCA and WCIF @@ -18,11 +18,18 @@ npm install @wca/helpers --save ## Development setup -## Meta +```sh +git clone +cd wca-helpers +npm install +npm run build +npm test +``` -Distributed under the GPL license. See `LICENSE` for more information. +## Release process -[https://github.com/thewca/wca-helpers](https://github.com/thewca/wca-helpers) +- Create a new PR bumping `package.json` version (and update `CHANGELOG.md` if needed). +- Merge the change to `master`; the `Release` GitHub Action will run tests/build, create a tag `v`, publish to npm, and generate a GitHub release. ## Contributing @@ -31,3 +38,9 @@ Distributed under the GPL license. See `LICENSE` for more information. 3. Commit your changes (`git commit -am 'Add some fooBar'`) 4. Push to the branch (`git push origin feature/fooBar`) 5. Create a new Pull Request + +## Meta + +Distributed under the GPL license. See `LICENSE` for more information. + +[https://github.com/thewca/wca-helpers](https://github.com/thewca/wca-helpers)