This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
v0.4.21 #38
Workflow file for this run
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: Publish new release to NPM | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
env: | |
NODE_OPTIONS: --max-old-space-size=8192 | |
outputs: | |
new-version: ${{ steps.new-version.outputs.new_version }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
#token: ${{ secrets.GITHUB_TOKEN }} | |
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH_PARODOS }} | |
fetch-depth: 0 | |
- name: Configuring git | |
run: | | |
git config user.name '${{ github.actor }}' | |
git config user.email 'github-actions@github.com' | |
- name: Parse the next package version | |
id: new-version | |
# The expected format of the new git tag is vX.Y.Z | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const new_version = '${{ github.ref_name }}'.slice(1); | |
core.setOutput('new_version', new_version); | |
- name: Check out the target branch | |
run: git checkout ${{ github.event.release.target_commitish }} | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
cache: yarn | |
node-version: 16 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Update the version in package.json | |
run: | | |
cd plugins/parodos | |
yarn version --new-version ${{ steps.new-version.outputs.new_version }} --no-git-tag-version | |
#git add package.json | |
#git commit -m 'Version ${{ steps.new-version.outputs.new_version }}' | |
#git tag -f -a ${{ github.ref_name }} -m '${{ github.ref_name }}' | |
#git push origin ${{ github.ref_name }} --force | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Linter | |
run: yarn lint:all | |
- name: Prettier | |
run: yarn prettier:check | |
- name: Unit tests | |
run: yarn test:all | |
- name: Typescript test | |
run: yarn tsc | |
- name: Build code | |
run: yarn build:all | |
- name: Publish to NPM | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }} | |
run: | | |
cd plugins/parodos | |
yarn publish --no-git-tag-version | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH_PARODOS }} | |
base: main | |
commit-message: 'Bump version to ${{ steps.new-version.outputs.new_version }}' | |
title: 'Bump version to ${{ steps.new-version.outputs.new_version }}' | |
body: > | |
This PR is auto-generated | |
branch: 'release/${{ steps.new-version.outputs.new_version }}' | |
- name: Login to Quay | |
uses: docker/login-action@v2 | |
with: | |
registry: 'quay.io' | |
username: 'parodos-dev+githubpush' | |
password: '${{ secrets.QUAY_GITHUB_TOKEN }}' | |
- name: 'Build and push container images' | |
env: | |
DOCKER_BUILDKIT: 1 | |
run: | | |
make build-image GIT_BRANCH="${{ steps.new-version.outputs.new_version }}" | |
make build-image-openshift GIT_BRANCH="${{ steps.new-version.outputs.new_version }}" | |
make push-image GIT_BRANCH="${{ steps.new-version.outputs.new_version }}" | |
make push-image-openshift GIT_BRANCH="${{ steps.new-version.outputs.new_version }}" | |
# Images for stable images, At the moment, we always release new one as stable. | |
make build-image GIT_BRANCH="stable" | |
make build-image-openshift GIT_BRANCH="stable" | |
make push-image GIT_BRANCH="stable" | |
make push-image-openshift GIT_BRANCH="stable" |