Create and publish release #188
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
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@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
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@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v4 | |
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@v4 | |
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@v4 | |
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@v4 | |
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/qeta-backend | |
steps: | |
- uses: actions/checkout@v4 | |
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@v4 | |
with: | |
node-version: 18.x | |
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@v4 | |
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@v4 | |
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 node module | |
runs-on: ubuntu-latest | |
needs: [tagged-release] | |
defaults: | |
run: | |
working-directory: ./plugins/qeta-node | |
steps: | |
- uses: actions/checkout@v4 | |
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@v4 | |
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/qeta-react | |
steps: | |
- uses: actions/checkout@v4 | |
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@v4 | |
with: | |
node-version: 18.x | |
cache: 'yarn' | |
- run: git pull | |
- run: yarn | |
- run: yarn tsc | |
- run: yarn build | |
- run: yarn npm publish | |
search-backend-publish: | |
name: Publish search backend module | |
runs-on: ubuntu-latest | |
needs: [tagged-release] | |
defaults: | |
run: | |
working-directory: ./plugins/search-backend-module-qeta | |
steps: | |
- uses: actions/checkout@v4 | |
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@v4 | |
with: | |
node-version: 18.x | |
cache: 'yarn' | |
- run: git pull | |
- run: yarn | |
- run: yarn tsc | |
- run: yarn build | |
- run: yarn npm publish | |
scaffolder-backend-publish: | |
name: Publish scaffolder backend module | |
runs-on: ubuntu-latest | |
needs: [tagged-release] | |
defaults: | |
run: | |
working-directory: ./plugins/scaffolder-backend-module-qeta | |
steps: | |
- uses: actions/checkout@v4 | |
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@v4 | |
with: | |
node-version: 18.x | |
cache: 'yarn' | |
- run: git pull | |
- run: yarn | |
- run: yarn tsc | |
- run: yarn build | |
- run: yarn npm publish | |
openai-module-publish: | |
name: Publish OpenAI backend module | |
runs-on: ubuntu-latest | |
needs: [tagged-release] | |
defaults: | |
run: | |
working-directory: ./plugins/qeta-backend-module-openai | |
steps: | |
- uses: actions/checkout@v4 | |
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@v4 | |
with: | |
node-version: 18.x | |
cache: 'yarn' | |
- run: git pull | |
- run: yarn | |
- run: yarn tsc | |
- run: yarn build | |
- run: yarn npm publish |