Skip to content

Commit

Permalink
ci: update release ci
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeysova committed Oct 7, 2021
1 parent f058c8a commit 6815790
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 26 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/intergration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,14 @@ jobs:
outputs:
version: ${{ steps.version.outputs.value }}

strategy:
matrix:
node-version: [14.x]

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

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js v14.x
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
node-version: v14.x
registry-url: 'https://npm.pkg.github.com'

- name: Install dependencies
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x]
node-version: [12.x, 14.x, 16.x]

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

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand All @@ -32,3 +33,6 @@ jobs:

- name: Test types
run: yarn test:types

- name: Build
run: yarn build
44 changes: 33 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,37 @@ jobs:
env:
CI: true

- name: Publish package
uses: JS-DevTools/npm-publish@v1
id: publish
- name: Build bundle
run: yarn build

- name: Set version from release
uses: reedyuk/[email protected]
with:
version: ${{ steps.version.outputs.tag }}
git-tag-version: false
package: 'dist/'

- name: Create NPM config
working-directory: './dist/'
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Check for NEXT tag
id: next
uses: actions-ecosystem/action-regex-match@v2
with:
token: ${{ secrets.NPM_TOKEN }}
check-version: true
access: 'public'

# log results
- if: steps.publish.outputs.type != 'none'
run: |
echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"
text: ${{ steps.version.outputs.tag }}
regex: 'next'

- name: Publish package with NEXT tag
if: ${{ steps.next.outputs.match != '' }}
working-directory: './dist/'
run: npm publish --tag next

- name: Publish package to latest
if: ${{ steps.next.outputs.match == '' }}
working-directory: './dist/'
run: npm publish


3 changes: 2 additions & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ on:
push:
branches:
- main
workflow_dispatch:

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5.11.0
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,10 @@ serverActionReceived({ type: 'another' });

# Development

## How to release
## Release process

1. Make changes with PullRequests
1. Set verision in [package.json](./package.json) from Draft release
1. Wait for updates of Draft release with github actions
1. Publish release and wait for publish-to-npm action
1. Check out the [draft release](https://github.com/effector/patronum/releases).
1. All PRs should have correct labels and useful titles. You can [review available labels here](https://github.com/effector/patronum/blob/master/.github/release-drafter.yml).
1. Update labels for PRs and titles, next [manually run the release drafter action](https://github.com/effector/patronum/actions/workflows/release-drafter.yml) to regenerate the draft release.
1. Review the new version and press "Publish"
1. If required check "Create discussion for this release"
3 changes: 2 additions & 1 deletion scripts/source.package.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module.exports = () => ({
name: 'patronum',
version: '1.2.0-next.2',
version: '0.0.0-real-version-will-be-set-on-ci',
description: '☄️ Effector utility library delivering modularity and convenience',
type: 'module',
main: 'patronum.cjs.js',
types: 'index.d.ts',
module: 'patronum.mjs',
browser: 'patronum.umd.js',
sideEffects: false,
repository: {
type: 'git',
url: 'git+https://github.com/effector/patronum.git',
Expand Down

0 comments on commit 6815790

Please sign in to comment.