Skip to content

Commit

Permalink
Beta release script
Browse files Browse the repository at this point in the history
  • Loading branch information
estruyf committed Jul 17, 2024
1 parent 03f90bd commit e59c699
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 5 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Beta release

on:
push:
branches:
- dev

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install npm dependencies
run: npm ci

- name: Run tests
run: npm run test:jest

release:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org

- name: Install npm dependencies
run: npm ci

- name: Run build
run: npm run build

- name: Update the package version
if: github.ref == 'refs/heads/dev'
run: node scripts/update-package-version.js $GITHUB_RUN_ID

- name: Publish release
run: npm publish --tag next --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
5 changes: 0 additions & 5 deletions .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ jobs:
cache: npm
registry-url: https://registry.npmjs.org

- name: Verify .npmrc file
run: |
echo $NPM_CONFIG_USERCONFIG
cat $NPM_CONFIG_USERCONFIG
- name: Install npm dependencies
run: npm ci

Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
src
test-results
tests
scripts

playwright.config.ts
tsconfig.json
Expand Down
6 changes: 6 additions & 0 deletions scripts/update-package-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const fs = require('fs');
const path = require('path');
const packageJson = require('../package.json');
packageJson.version += `-beta.${process.argv[process.argv.length - 1].substring(0, 7)}`;
console.log(packageJson.version);
fs.writeFileSync(path.join(path.resolve('.'), 'package.json'), JSON.stringify(packageJson, null, 2));

0 comments on commit e59c699

Please sign in to comment.