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

release/next #35

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
39 changes: 38 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ jobs:

publish:
name: Publish extra information about the build
if: startsWith(github.ref, 'refs/heads/master')
needs: test

runs-on: ubuntu-latest

steps:
Expand All @@ -95,3 +95,40 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

release-candidate:
name: Publish a release candidate
if: startsWith(github.ref, 'refs/tags/v')
needs: test
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo ${GITHUB_REF/refs\/tags\//} | sed 's/^v//')

- name: Set the tag name to package.json
run: >-
node -e "
const fs = require('fs');
const packageJson = require('./package.json');
const version = '${{ steps.get_version.outputs.VERSION }}';
fs.writeFileSync('./package.json', JSON.stringify({ ...packageJson, version }));
"

- name: Setup node.js
uses: actions/setup-node@v2
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Release
run: npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
15 changes: 0 additions & 15 deletions .releaserc

This file was deleted.

15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,12 @@ and [semantic-release](https://github.com/semantic-release/semantic-release) for

### Release Candidates

To make a (temporary) release candidate, you can use the following commands:
To make a (temporary) release candidate, push a new tag. The version in `package.json` will be the same as the tagname without the `v` prefix.

```bash
# Create a new rc from the latest/remote develop
npm run release-candidate
git tag v5.0.0-rc.1 && git push origin v5.0.0-rc.1
```

or

```bash
# Create a new rc from a specific branch
npm run release-candidate -- feature/SKED-XXXX
```

That command will make a new `rc` branch (locally and remotely) on which `semantic-release` is configured
to create a new release candidate (see `.releaserc`).

### Final Releases

Since `semantic-release` is currently configured to run on any `push`'es to `master`,
Expand Down
40 changes: 0 additions & 40 deletions npm_scripts/release-candidate.sh

This file was deleted.

10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,21 @@
"dist",
"src"
],
"engines": {
"node": "16"
},
"peerDependencies": {},
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"build": "tsdx build --format cjs,esm,umd --name SkedifyUriEncoding",
"test": "npm run test:client && npm run test:src --",
"test:src": "tsdx test",
"test:client": "node client/test/run.js ./client/test/*-test.js",
"tdd": "npm run test -- --watch",
"lint": "tsdx lint client",
"format": "npm run lint -- --fix",
"prepare": "husky install && tsdx build",
"prepare": "husky install && npm run build",
"check-coverage": "npm run test -- --ci --coverage",
"commit": "git-cz",
"commit:lint": "commitlint --edit \"$1\"",
"semantic-release": "semantic-release",
"release-candidate": "npm_scripts/release-candidate.sh"
"semantic-release": "semantic-release"
},
"prettier": {
"printWidth": 80,
Expand Down
7 changes: 6 additions & 1 deletion tsdx.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
const replace = require('@rollup/plugin-replace');

module.exports = {
// See https://github.com/formium/tsdx/issues/981
rollup(config, opts) {
// see https://github.com/formium/tsdx/issues/179
if (config.output.format === 'umd') {
delete config.external;
}

// See https://github.com/formium/tsdx/issues/981
config.plugins = config.plugins.map(p =>
p.name === 'replace'
? replace({
Expand Down
Loading