|
|
|
@ -1,15 +1,19 @@
|
|
|
|
|
name: "Release : NPM packages" |
|
|
|
|
|
|
|
|
|
on: |
|
|
|
|
# Triggered manually |
|
|
|
|
workflow_dispatch: |
|
|
|
|
inputs: |
|
|
|
|
tag: |
|
|
|
|
description: "Tag" |
|
|
|
|
required: true |
|
|
|
|
prev_tag: |
|
|
|
|
description: "Previous Tag" |
|
|
|
|
type: string |
|
|
|
|
# Triggered by release-nocodb.yml |
|
|
|
|
workflow_call: |
|
|
|
|
inputs: |
|
|
|
|
tag: |
|
|
|
|
description: "Tag" |
|
|
|
|
required: true |
|
|
|
|
|
|
|
|
|
jobs: |
|
|
|
|
release: |
|
|
|
|
runs-on: ubuntu-latest |
|
|
|
@ -31,7 +35,7 @@ jobs:
|
|
|
|
|
npm run build:copy:jsdeliver |
|
|
|
|
cd ../.. |
|
|
|
|
npm install |
|
|
|
|
VERSION=${{github.event.inputs.tag}} node scripts/upgradeNcGui.js node scripts/upgradeNcGui.js && cd packages/nocodb && npm run obfuscate:build:publish |
|
|
|
|
VERSION=${{ github.event.inputs.tag || inputs.tag }} node scripts/upgradeNcGui.js node scripts/upgradeNcGui.js && cd packages/nocodb && npm run obfuscate:build:publish |
|
|
|
|
env: |
|
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
|
|
|
|
- name: Create Pull Request |
|
|
|
@ -46,7 +50,7 @@ jobs:
|
|
|
|
|
signoff: true |
|
|
|
|
branch: release-patches |
|
|
|
|
delete-branch: true |
|
|
|
|
title: 'Release ${{github.event.inputs.tag}}' |
|
|
|
|
title: 'Release ${{ github.event.inputs.tag || inputs.tag }}' |
|
|
|
|
labels: | |
|
|
|
|
automerge |
|
|
|
|
|
|
|
|
@ -60,97 +64,3 @@ jobs:
|
|
|
|
|
env: |
|
|
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
|
|
|
|
PULL_REQUEST: "${{ steps.cpr.outputs.pull-request-number }}" |
|
|
|
|
buildx: |
|
|
|
|
runs-on: ubuntu-latest |
|
|
|
|
needs: [release] |
|
|
|
|
env: |
|
|
|
|
working-directory: ./packages/nocodb |
|
|
|
|
strategy: |
|
|
|
|
matrix: |
|
|
|
|
node-version: [ 12 ] |
|
|
|
|
steps: |
|
|
|
|
- name: Checkout |
|
|
|
|
uses: actions/checkout@v2 |
|
|
|
|
|
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }} |
|
|
|
|
uses: actions/setup-node@v2 |
|
|
|
|
with: |
|
|
|
|
node-version: ${{ matrix.node-version }} |
|
|
|
|
|
|
|
|
|
- uses: bahmutov/npm-install@v1 |
|
|
|
|
with: |
|
|
|
|
working-directory: ${{ env.working-directory }} |
|
|
|
|
|
|
|
|
|
- name: Build nocodb and docker files |
|
|
|
|
run: | |
|
|
|
|
npm run build |
|
|
|
|
npm run docker:build |
|
|
|
|
working-directory: ${{ env.working-directory }} |
|
|
|
|
|
|
|
|
|
- name: Set up QEMU |
|
|
|
|
uses: docker/setup-qemu-action@v1 |
|
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx |
|
|
|
|
id: buildx |
|
|
|
|
uses: docker/setup-buildx-action@v1 |
|
|
|
|
|
|
|
|
|
- name: Cache Docker layers |
|
|
|
|
uses: actions/cache@v2 |
|
|
|
|
with: |
|
|
|
|
path: /tmp/.buildx-cache |
|
|
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }} |
|
|
|
|
restore-keys: | |
|
|
|
|
${{ runner.os }}-buildx- |
|
|
|
|
|
|
|
|
|
- name: Login to DockerHub |
|
|
|
|
uses: docker/login-action@v1 |
|
|
|
|
with: |
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }} |
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }} |
|
|
|
|
|
|
|
|
|
- name: Build and push |
|
|
|
|
uses: docker/build-push-action@v2 |
|
|
|
|
with: |
|
|
|
|
context: ${{ env.working-directory }} |
|
|
|
|
build-args: NC_VERSION=${{ github.event.inputs.tag }} |
|
|
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7 |
|
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache |
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache-new |
|
|
|
|
push: true |
|
|
|
|
tags: | |
|
|
|
|
nocodb/nocodb:${{ github.event.inputs.tag }} |
|
|
|
|
nocodb/nocodb:latest |
|
|
|
|
|
|
|
|
|
# Temp fix |
|
|
|
|
# https://github.com/docker/build-push-action/issues/252 |
|
|
|
|
# https://github.com/moby/buildkit/issues/1896 |
|
|
|
|
- name: Move cache |
|
|
|
|
run: | |
|
|
|
|
rm -rf /tmp/.buildx-cache |
|
|
|
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache |
|
|
|
|
draft: |
|
|
|
|
runs-on: ubuntu-latest |
|
|
|
|
needs: [release] |
|
|
|
|
steps: |
|
|
|
|
- name: Create tag |
|
|
|
|
uses: actions/github-script@v3 |
|
|
|
|
with: |
|
|
|
|
github-token: ${{ secrets.GH_TOKEN }} |
|
|
|
|
script: | |
|
|
|
|
github.git.createRef({ |
|
|
|
|
owner: context.repo.owner, |
|
|
|
|
repo: context.repo.repo, |
|
|
|
|
ref: "refs/tags/${{ github.event.inputs.tag }}", |
|
|
|
|
sha: context.sha |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
- uses: actions/checkout@v2 |
|
|
|
|
with: |
|
|
|
|
fetch-depth: 0 |
|
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v2 |
|
|
|
|
with: |
|
|
|
|
node-version: 14 |
|
|
|
|
- run: "npx github-release-notes@0.17.2 release --token ${{ secrets.GH_TOKEN }} --draft --tags ${{ github.event.inputs.tag }}..${{ github.event.inputs.prev_tag }}" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|