Set version 8.1.1 #18
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: Release libs (NPM) | |
on: | |
push: | |
tags: | |
- libs-v* | |
jobs: | |
npm-publish: | |
name: Publish the libs on NPM | |
runs-on: ubuntu-latest | |
environment: production | |
timeout-minutes: 15 | |
env: | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
- name: Update NPM | |
run: | | |
npm install -g npm@latest | |
- uses: actions/cache@v4 | |
id: cache-modules | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }} | |
- name: Install dependencies | |
if: steps.cache-modules.outputs.cache-hit != 'true' | |
run: | | |
npm run bootstrap | |
- name: Link packages | |
run: | | |
npm run link | |
- name: Build | |
run: | | |
npm run build:libs | |
npm run build:serverless | |
npm run build:cli | |
- name: Add NPM token | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc | |
git update-index --assume-unchanged .npmrc | |
- name: NPM publish | |
run: | | |
npm run publish | |
cli-docker: | |
name: Push Docker image | |
runs-on: ubuntu-latest | |
environment: production | |
timeout-minutes: 15 | |
needs: npm-publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract app version | |
id: app-version | |
run: | | |
PACKAGE_VERSION=$(node -p -e "require('./packages/cli/package.json').version") | |
PACKAGE_MAJOR_VERSION=$(node -p -e "require('./packages/cli/package.json').version.split('.')[0]") | |
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT | |
echo "PACKAGE_MAJOR_VERSION=$PACKAGE_MAJOR_VERSION" >> $GITHUB_OUTPUT | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: "arm64,arm,x86_64" | |
- uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v4 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
context: ./packages/cli/docker | |
tags: | | |
mockoon/cli:latest | |
mockoon/cli:${{steps.app-version.outputs.PACKAGE_VERSION}} | |
mockoon/cli:${{steps.app-version.outputs.PACKAGE_MAJOR_VERSION}} | |
build-args: | | |
version=${{steps.app-version.outputs.PACKAGE_VERSION}} |