Skip to content

Create and publish release #85

Create and publish release

Create and publish release #85

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: [16.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 tsc
- run: yarn build
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.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 ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
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/qeta
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 ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
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/qeta-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 ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: git pull
- run: yarn
- run: yarn tsc
- run: yarn build
- run: yarn npm publish
common-publish:
name: Publish plugin common
runs-on: ubuntu-latest
needs: [tagged-release]
defaults:
run:
working-directory: ./plugins/qeta-common
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 ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: git pull
- run: yarn
- run: yarn tsc
- run: yarn build
- run: yarn npm publish