多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

128 lines
4.0 KiB

name: 'NocoDB Release'
on:
# Triggered manually
workflow_dispatch:
inputs:
tag:
description: "Target Tag"
required: false
prev_tag:
description: "Previous Tag"
required: false
jobs:
# Validate Branch
validate-branch:
runs-on: ubuntu-latest
steps:
- run: |
if [[ ${{ github.ref }} != 'refs/heads/master' ]]; then
echo "NocoDB Release is only allowed to run on master branch"
exit 1
fi
# Process Input
process-input:
runs-on: ubuntu-latest
needs: validate-branch
outputs:
target_tag: ${{ steps.process-input.outputs.target_tag }}
prev_tag: ${{ steps.process-input.outputs.prev_tag }}
steps:
- id: process-input
name: process-input
run: |
TARGET_TAG=${{github.event.inputs.tag}}
PREV_TAG=${{github.event.inputs.prev_tag}}
if [[ ${PREV_TAG} == '' ]]; then
# fetch the latest version
PREV_TAG=$(basename $(curl -fs -o/dev/null -w %{redirect_url} https://github.com/nocodb/nocodb/releases/latest))
fi
if [[ ${TARGET_TAG} == '' ]]; then
# bump the version from PREV_TAG
TARGET_TAG=$(echo ${PREV_TAG} | awk -F. -v OFS=. '{$NF += 1 ; print}')
fi
echo "TARGET_TAG=${TARGET_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
pr-to-master:
needs: process-input
uses: ./.github/workflows/pr-to-master.yml
with:
tag: ${{ needs.process-input.outputs.target_tag }}
targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }}
# Build, install, publish frontend and backend to npm
release-npm:
needs: [pr-to-master, process-input]
uses: ./.github/workflows/release-npm.yml
with:
tag: ${{ needs.process-input.outputs.target_tag }}
targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }}
secrets:
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
# Draft Release Note
release-draft-note:
needs: [release-npm, process-input]
uses: ./.github/workflows/release-draft.yml
with:
tag: ${{ needs.process-input.outputs.target_tag }}
prev_tag: ${{ needs.process-input.outputs.prev_tag }}
tagHeadSHA: 'N'
secrets:
NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}"
# Build docker image and push to docker hub
release-docker:
needs: [release-draft-note, process-input]
uses: ./.github/workflows/release-docker.yml
with:
currentVersion: 'N/A'
tag: ${{ needs.process-input.outputs.target_tag }}
targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }}
secrets:
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
# Build executables and publish to GitHub
release-executables:
needs: [release-draft-note, process-input]
uses: ./.github/workflows/release-executables.yml
with:
tag: ${{ needs.process-input.outputs.target_tag }}
secrets:
NC_GITHUB_TOKEN: "${{ secrets.NC_GITHUB_TOKEN }}"
# Close all issues with target tags 'Status: Ready for Next Release'
close-issues:
needs: [release-docker, process-input]
uses: ./.github/workflows/release-close-issue.yml
with:
issue_label: '🚀 Status: Ready for Next Release'
version: ${{ needs.process-input.outputs.target_tag }}
# Publish Docs
publish-docs:
needs: close-issues
uses: ./.github/workflows/publish-docs.yml
secrets:
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
# Change nocodb-sdk back to local path
update-sdk-path:
needs: publish-docs
uses: ./.github/workflows/update-sdk-path.yml
# Sync changes to develop
sync-to-develop:
needs: update-sdk-path
uses: ./.github/workflows/sync-to-develop.yml