Skip to content

Create and publish release #53

Create and publish release

Create and publish release #53

Workflow file for this run

name: Create and publish release
on: [workflow_dispatch]
permissions:
contents: write
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn install --immutable
- run: yarn lint:all
- run: yarn prettier:check
- run: yarn tsc
- run: yarn build
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn install --immutable
- run: yarn test:all
bump-version:
name: Bump version
runs-on: ubuntu-latest
needs: [lint, tests]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
- run: git pull
- run: yarn
- run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- run: yarn bump
- run: git push --follow-tags
tagged-release:
name: Create tagged release
needs: [bump-version]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git pull
- name: 'Get Previous tag'
id: previoustag
uses: 'WyriHaximus/github-action-get-previous-tag@v1'
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
prerelease: false
automatic_release_tag: ${{ steps.previoustag.outputs.tag }}
files: 'CHANGELOG.md'
frontend-publish:
name: Publish plugin frontend
runs-on: ubuntu-latest
needs: [tagged-release]
defaults:
run:
working-directory: ./plugins/toolbox
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create yarnrc.yml
run: |
echo "npmAuthToken: ${{ secrets.NPM_TOKEN }}" >> ~/.yarnrc.yml
echo "npmAlwaysAuth: true" >> ~/.yarnrc.yml
echo "npmPublishRegistry: https://registry.npmjs.org" >> ~/.yarnrc.yml
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
- run: git pull
- run: yarn
- run: yarn tsc
- run: yarn build
- run: yarn npm publish
react-publish:
name: Publish plugin react
runs-on: ubuntu-latest
needs: [tagged-release]
defaults:
run:
working-directory: ./plugins/toolbox-react
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create yarnrc.yml
run: |
echo "npmAuthToken: ${{ secrets.NPM_TOKEN }}" >> ~/.yarnrc.yml
echo "npmAlwaysAuth: true" >> ~/.yarnrc.yml
echo "npmPublishRegistry: https://registry.npmjs.org" >> ~/.yarnrc.yml
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
- run: git pull
- run: yarn
- run: yarn tsc
- run: yarn build
- run: yarn npm publish
backend-publish:
name: Publish plugin backend
runs-on: ubuntu-latest
needs: [tagged-release]
defaults:
run:
working-directory: ./plugins/toolbox-backend
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create yarnrc.yml
run: |
echo "npmAuthToken: ${{ secrets.NPM_TOKEN }}" >> ~/.yarnrc.yml
echo "npmAlwaysAuth: true" >> ~/.yarnrc.yml
echo "npmPublishRegistry: https://registry.npmjs.org" >> ~/.yarnrc.yml
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
- run: git pull
- run: yarn
- run: yarn tsc
- run: yarn build
- run: yarn npm publish
node-publish:
name: Publish plugin node
runs-on: ubuntu-latest
needs: [tagged-release]
defaults:
run:
working-directory: ./plugins/toolbox-node
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create yarnrc.yml
run: |
echo "npmAuthToken: ${{ secrets.NPM_TOKEN }}" >> ~/.yarnrc.yml
echo "npmAlwaysAuth: true" >> ~/.yarnrc.yml
echo "npmPublishRegistry: https://registry.npmjs.org" >> ~/.yarnrc.yml
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
- run: git pull
- run: yarn
- run: yarn tsc
- run: yarn build
- run: yarn npm publish
whois-module-publish:
name: Publish plugin whois-module
runs-on: ubuntu-latest
needs: [tagged-release]
defaults:
run:
working-directory: ./plugins/toolbox-backend-module-whois
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create yarnrc.yml
run: |
echo "npmAuthToken: ${{ secrets.NPM_TOKEN }}" >> ~/.yarnrc.yml
echo "npmAlwaysAuth: true" >> ~/.yarnrc.yml
echo "npmPublishRegistry: https://registry.npmjs.org" >> ~/.yarnrc.yml
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'yarn'
- run: git pull
- run: yarn
- run: yarn tsc
- run: yarn build
- run: yarn npm publish