Browse Source

fix(nc-gui): set output if env is shared between jobs

pull/4175/head
Wing-Kam Wong 2 years ago
parent
commit
b25e8a11fe
  1. 6
      .github/workflows/release-docker.yml
  2. 2
      .github/workflows/release-draft.yml
  3. 2
      .github/workflows/release-executables.yml
  4. 23
      .github/workflows/release-nightly-dev.yml
  5. 23
      .github/workflows/release-nocodb.yml
  6. 32
      .github/workflows/release-pr.yml

6
.github/workflows/release-docker.yml

@ -127,14 +127,14 @@ jobs:
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: ${{ env.working-directory }} context: ${{ env.working-directory }}
build-args: NC_VERSION=${{ env.DOCKER_BUILD_TAG }} build-args: NC_VERSION=${{ steps.get-docker-repository.outputs.DOCKER_BUILD_TAG }}
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v7
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new cache-to: type=local,dest=/tmp/.buildx-cache-new
push: true push: true
tags: | tags: |
nocodb/${{ env.DOCKER_REPOSITORY }}:${{ env.DOCKER_BUILD_TAG }} nocodb/${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}:${{ steps.get-docker-repository.outputs.DOCKER_BUILD_TAG }}
nocodb/${{ env.DOCKER_REPOSITORY }}:latest nocodb/${{ steps.get-docker-repository.outputs.DOCKER_REPOSITORY }}:latest
# Temp fix # Temp fix
# https://github.com/docker/build-push-action/issues/252 # https://github.com/docker/build-push-action/issues/252

2
.github/workflows/release-draft.yml

@ -66,7 +66,7 @@ jobs:
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
ref: "refs/tags/${{ github.event.inputs.tag || inputs.tag }}", ref: "refs/tags/${{ github.event.inputs.tag || inputs.tag }}",
sha: "${{ env.TARGET_SHA }}" sha: "${{ steps.get-sha.outputs.TARGET_SHA }}"
}) })
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:

2
.github/workflows/release-executables.yml

@ -240,7 +240,7 @@ jobs:
desc "NocoDB : Opensource smart spreadsheet" desc "NocoDB : Opensource smart spreadsheet"
homepage "https://github.com/nocodb/nocodb" homepage "https://github.com/nocodb/nocodb"
url "https://github.com/nocodb/nocodb/releases/download/${{ github.event.inputs.tag || inputs.tag }}/nocodb.tar.gz" url "https://github.com/nocodb/nocodb/releases/download/${{ github.event.inputs.tag || inputs.tag }}/nocodb.tar.gz"
sha256 "${{ env.CHECKSUM }}" sha256 "${{ steps.compress.outputs.CHECKSUM }}"
license "MIT" license "MIT"
version "${{ github.event.inputs.tag || inputs.tag }}" version "${{ github.event.inputs.tag || inputs.tag }}"

23
.github/workflows/release-nightly-dev.yml

@ -29,16 +29,21 @@ jobs:
echo "NIGHTLY_BUILD_TAG=${TAG_NAME}" >> $GITHUB_OUTPUT echo "NIGHTLY_BUILD_TAG=${TAG_NAME}" >> $GITHUB_OUTPUT
echo "IS_DAILY=${IS_DAILY}" >> $GITHUB_OUTPUT echo "IS_DAILY=${IS_DAILY}" >> $GITHUB_OUTPUT
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_OUTPUT echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_OUTPUT
# verify - name: verify-tag
echo NIGHTLY_BUILD_TAG: ${{ env.NIGHTLY_BUILD_TAG }} run: |
echo IS_DAILY: ${{ env.IS_DAILY }} echo ${{ steps.tag-step.outputs.NIGHTLY_BUILD_TAG }}
echo CURRENT_VERSION: ${{ env.CURRENT_VERSION }} echo ${{ steps.tag-step.outputs.IS_DAILY }}
echo ${{ steps.tag-step.outputs.CURRENT_VERSION }}
outputs:
nightly_build_tag: ${{ steps.tag-step.outputs.NIGHTLY_BUILD_TAG }}
is_daily: ${{ steps.tag-step.outputs.IS_DAILY }}
current_version: ${{ steps.tag-step.outputs.CURRENT_VERSION }}
# Build frontend and backend and publish to npm # Build frontend and backend and publish to npm
release-npm: release-npm:
needs: set-tag needs: set-tag
uses: ./.github/workflows/release-npm.yml uses: ./.github/workflows/release-npm.yml
with: with:
tag: ${{ env.NIGHTLY_BUILD_TAG }} tag: ${{ needs.set-tag.outputs.nightly_build_tag }}
targetEnv: 'DEV' targetEnv: 'DEV'
secrets: secrets:
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}" NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
@ -48,7 +53,7 @@ jobs:
needs: [set-tag, release-npm] needs: [set-tag, release-npm]
uses: ./.github/workflows/release-timely-executables.yml uses: ./.github/workflows/release-timely-executables.yml
with: with:
tag: ${{ env.CURRENT_VERSION }}-${{ env.NIGHTLY_BUILD_TAG }} tag: ${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.nightly_build_tag }}
secrets: secrets:
NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}" NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}"
@ -57,10 +62,10 @@ jobs:
needs: [set-tag, release-npm] needs: [set-tag, release-npm]
uses: ./.github/workflows/release-docker.yml uses: ./.github/workflows/release-docker.yml
with: with:
currentVersion: ${{ env.CURRENT_VERSION }} currentVersion: ${{ needs.set-tag.outputs.current_version }}
tag: ${{ env.NIGHTLY_BUILD_TAG }} tag: ${{ needs.set-tag.outputs.nightly_build_tag }}
targetEnv: 'DEV' targetEnv: 'DEV'
isDaily: ${{ env.IS_DAILY }} isDaily: ${{ needs.set-tag.outputs.is_daily }}
secrets: secrets:
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}" DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"

23
.github/workflows/release-nocodb.yml

@ -25,6 +25,9 @@ jobs:
process-input: process-input:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: validate-branch needs: validate-branch
outputs:
target_tag: ${{ steps.process-input.outputs.target_tag }}
prev_tag: ${{ steps.process-input.outputs.prev_tag }}
steps: steps:
- id: process-input - id: process-input
name: process-input name: process-input
@ -42,17 +45,19 @@ jobs:
TARGET_TAG=$(echo ${PREV_TAG} | awk -F. -v OFS=. '{$NF += 1 ; print}') TARGET_TAG=$(echo ${PREV_TAG} | awk -F. -v OFS=. '{$NF += 1 ; print}')
fi fi
echo target version: ${TARGET_TAG}
echo previous version: ${PREV_TAG}
echo "TARGET_TAG=${TARGET_TAG}" >> $GITHUB_OUTPUT echo "TARGET_TAG=${TARGET_TAG}" >> $GITHUB_OUTPUT
echo "PREV_TAG=${PREV_TAG}" >> $GITHUB_OUTPUT echo "PREV_TAG=${PREV_TAG}" >> $GITHUB_OUTPUT
- name: Verify
run : |
echo TARGET_TAG: ${{ steps.process-input.outputs.target_tag }}
echo PREV_TAG: ${{ steps.process-input.outputs.prev_tag }}
# Merge develop to master # Merge develop to master
pr-to-master: pr-to-master:
needs: process-input needs: process-input
uses: ./.github/workflows/pr-to-master.yml uses: ./.github/workflows/pr-to-master.yml
with: with:
tag: ${{ env.TARGET_TAG }} tag: ${{ needs.process-input.outputs.target_tag }}
targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }} targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }}
# Build, install, publish frontend and backend to npm # Build, install, publish frontend and backend to npm
@ -60,7 +65,7 @@ jobs:
needs: [pr-to-master, process-input] needs: [pr-to-master, process-input]
uses: ./.github/workflows/release-npm.yml uses: ./.github/workflows/release-npm.yml
with: with:
tag: ${{ env.TARGET_TAG }} tag: ${{ needs.process-input.outputs.target_tag }}
targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }} targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }}
secrets: secrets:
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}" NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
@ -70,8 +75,8 @@ jobs:
needs: [release-npm, process-input] needs: [release-npm, process-input]
uses: ./.github/workflows/release-draft.yml uses: ./.github/workflows/release-draft.yml
with: with:
tag: ${{ env.TARGET_TAG }} tag: ${{ needs.process-input.outputs.target_tag }}
prev_tag: ${{ env.PREV_TAG }} prev_tag: ${{ needs.process-input.outputs.prev_tag }}
tagHeadSHA: 'N' tagHeadSHA: 'N'
secrets: secrets:
NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}" NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}"
@ -82,7 +87,7 @@ jobs:
uses: ./.github/workflows/release-docker.yml uses: ./.github/workflows/release-docker.yml
with: with:
currentVersion: 'N/A' currentVersion: 'N/A'
tag: ${{ env.TARGET_TAG }} tag: ${{ needs.process-input.outputs.target_tag }}
targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }} targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }}
secrets: secrets:
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}" DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
@ -93,7 +98,7 @@ jobs:
needs: [release-draft-note, process-input] needs: [release-draft-note, process-input]
uses: ./.github/workflows/release-executables.yml uses: ./.github/workflows/release-executables.yml
with: with:
tag: ${{ env.TARGET_TAG }} tag: ${{ needs.process-input.outputs.target_tag }}
secrets: secrets:
NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}" NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}"
@ -103,7 +108,7 @@ jobs:
uses: ./.github/workflows/release-close-issue.yml uses: ./.github/workflows/release-close-issue.yml
with: with:
issue_label: '🚀 Status: Ready for Next Release' issue_label: '🚀 Status: Ready for Next Release'
version: ${{ env.TARGET_TAG }} version: ${{ needs.process-input.outputs.target_tag }}
# Publish Docs # Publish Docs
publish-docs: publish-docs:

32
.github/workflows/release-pr.yml

@ -37,9 +37,13 @@ jobs:
TAG_NAME=pr-${PR_NUMBER}-${CURRENT_DATE}-${CURRENT_TIME} TAG_NAME=pr-${PR_NUMBER}-${CURRENT_DATE}-${CURRENT_TIME}
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_OUTPUT echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_OUTPUT
# Verify - name: verify-tag
echo env.TARGET_TAG: ${{ env.TARGET_TAG }} run: |
echo env.CURRENT_VERSION: ${{ env.CURRENT_VERSION }} echo ${{ steps.tag-step.outputs.TARGET_TAG }}
echo ${{ steps.tag-step.outputs.CURRENT_VERSION }}
outputs:
target_tag: ${{ steps.tag-step.outputs.TARGET_TAG }}
current_version: ${{ steps.tag-step.outputs.CURRENT_VERSION }}
# Build, install, publish frontend and backend to npm # Build, install, publish frontend and backend to npm
release-npm: release-npm:
@ -47,7 +51,7 @@ jobs:
needs: [set-tag] needs: [set-tag]
uses: ./.github/workflows/release-npm.yml uses: ./.github/workflows/release-npm.yml
with: with:
tag: ${{ env.TARGET_TAG }} tag: ${{ needs.set-tag.outputs.target_tag }}
targetEnv: 'DEV' targetEnv: 'DEV'
secrets: secrets:
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}" NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
@ -58,8 +62,8 @@ jobs:
needs: [release-npm, set-tag] needs: [release-npm, set-tag]
uses: ./.github/workflows/release-docker.yml uses: ./.github/workflows/release-docker.yml
with: with:
currentVersion: ${{ env.CURRENT_VERSION }} currentVersion: ${{ needs.set-tag.outputs.current_version }}
tag: ${{ env.TARGET_TAG }} tag: ${{ needs.set-tag.outputs.target_tag }}
targetEnv: 'DEV' targetEnv: 'DEV'
isDaily: 'N' isDaily: 'N'
secrets: secrets:
@ -72,7 +76,7 @@ jobs:
needs: [set-tag, release-npm] needs: [set-tag, release-npm]
uses: ./.github/workflows/release-timely-executables.yml uses: ./.github/workflows/release-timely-executables.yml
with: with:
tag: ${{ env.CURRENT_VERSION }}-${{ env.TARGET_TAG }} tag: ${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}
secrets: secrets:
NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}" NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}"
@ -87,7 +91,7 @@ jobs:
body: | body: |
The PR changes have been deployed. Please run the following command to verify: The PR changes have been deployed. Please run the following command to verify:
``` ```
docker run -d -p 8888:8080 nocodb/nocodb-timely:${{ env.CURRENT_VERSION }}-${{ env.TARGET_TAG }} docker run -d -p 8888:8080 nocodb/nocodb-timely:${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}
``` ```
# Add a comment for PR executable build # Add a comment for PR executable build
@ -104,24 +108,24 @@ jobs:
#### MacOS #### MacOS
```bash ```bash
mkdir -p ./${{ env.CURRENT_VERSION }}/${{ env.TARGET_TAG }} && cd "$_" \ mkdir -p ./${{ needs.set-tag.outputs.current_version }}/${{ needs.set-tag.outputs.target_tag }} && cd "$_" \
&& curl http://dl.nocodb.com/${{ env.CURRENT_VERSION }}-${{ env.TARGET_TAG }}/Noco-macos-arm64 -o noco -L \ && curl http://dl.nocodb.com/${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}/Noco-macos-arm64 -o noco -L \
&& chmod +x noco \ && chmod +x noco \
&& ./noco && ./noco
``` ```
#### Linux #### Linux
```bash ```bash
mkdir -p ./${{ env.CURRENT_VERSION }}/${{ env.TARGET_TAG }} && cd "$_" \ mkdir -p ./${{ needs.set-tag.outputs.current_version }}/${{ needs.set-tag.outputs.target_tag }} && cd "$_" \
&& curl http://dl.nocodb.com/${{ env.CURRENT_VERSION }}-${{ env.TARGET_TAG }}/Noco-linux-x64 -o noco -L \ && curl http://dl.nocodb.com/${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}/Noco-linux-x64 -o noco -L \
&& chmod +x noco \ && chmod +x noco \
&& ./noco && ./noco
``` ```
#### Windows #### Windows
```bash ```bash
iwr http://dl.nocodb.com/${{ env.CURRENT_VERSION }}-${{ env.TARGET_TAG }}/Noco-win-arm64.exe iwr http://dl.nocodb.com/${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}/Noco-win-arm64.exe
.\Noco-win-arm64.exe .\Noco-win-arm64.exe
``` ```
For executables visit [here](https://github.com/nocodb/nocodb-timely/releases/tag/${{ env.CURRENT_VERSION }}-${{ env.TARGET_TAG }}) For executables visit [here](https://github.com/nocodb/nocodb-timely/releases/tag/${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }})

Loading…
Cancel
Save