Skip to content

Commit

Permalink
chore: release ci (nocobase#4293)
Browse files Browse the repository at this point in the history
* chore: release ci

* chore: release ci

* chore: release ci

* chore: release ci

* chore: release ci

* chore: release ci

* chore: release ci

* chore: release ci

* chore: release ci

* chore: release ci

* chore: release ci

* chore: release ci
  • Loading branch information
chareice authored May 9, 2024
1 parent 65f8bd4 commit 03fdee1
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 44 deletions.
64 changes: 41 additions & 23 deletions .github/workflows/manual-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,48 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
on:
workflow_dispatch:
inputs:
pr_number:
description: 'Please enter a pull request number'
required: true
jobs:
build:
push-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- run: gh pr checkout ${{ inputs.pr_number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit files
run: |
yarn install
yarn version:alpha -y
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -a -m "Add changes"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
- name: Checkout
uses: actions/checkout@v3
- name: Checkout pro-plugins
uses: actions/checkout@v4
with:
repository: nocobase/pro-plugins
path: packages/pro-plugins
ssh-key: ${{ secrets.PRO_PLUGINS_DEPLOY_KEY }}
persist-credentials: true
- name: Set Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install
- name: Run release.sh
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions Bot"
echo "packages/pro-plugins/" >> .git/info/exclude
bash release.sh
- name: push pro plugins
uses: ad-m/github-push-action@master
with:
ssh: true
branch: main
directory: packages/pro-plugins
repository: nocobase/pro-plugins
tags: true
atomic: true
- name: push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
tags: true
atomic: true
44 changes: 25 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@ jobs:
runs-on: ubuntu-latest
container: node:18
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v3
-
name: yarn install and build
- name: Checkout pro-plugins
uses: actions/checkout@v3
with:
repository: nocobase/pro-plugins
path: packages/pro-plugins
ssh-key: ${{ secrets.SUBMODULE_SSH_KEY }}
- name: yarn install and build
run: |
yarn config set registry https://registry.npmjs.org/
yarn install
yarn build
-
name: publish npmjs.org
- name: publish npmjs.org
run: |
git config --global user.email "[email protected]"
git config --global user.name "test"
Expand All @@ -40,21 +43,26 @@ jobs:
yarn config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npm whoami
yarn release:force --no-verify-access --no-git-reset --registry https://registry.npmjs.org/
- name: publish pkg.nocobase.com
run: |
yarn config set //pkg.nocobase.com/:_authToken=${{ secrets.PKG_NOCOBASE_TOKEN }}
yarn release:force --no-verify-access --no-git-reset --registry https://pkg.nocobase.com
- name: publish pkg-src.nocobase.com
run: |
bash generate-npmignore.sh ignore-src
yarn config set //pkg-src.nocobase.com/:_authToken=${{ secrets.PKG_SRC_NOCOBASE_TOKEN }}
yarn release:force --no-verify-access --no-git-reset --registry https://pkg-src.nocobase.com
push-docker:
runs-on: ubuntu-latest
needs: publish-npm
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Docker meta
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
Expand All @@ -65,17 +73,15 @@ jobs:
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
-
name: Login to Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ./docker/nocobase
platforms: linux/amd64,linux/arm64
push: true
tags: nocobase/nocobase:latest,${{ steps.meta.outputs.tags }}
tags: nocobase/nocobase:latest,${{ steps.meta.outputs.tags }}
4 changes: 2 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ cd ./packages/pro-plugins
git add .
git commit -m "chore(versions): 😊 publish v$(jq -r '.version' ../../lerna.json)"
git tag v$(jq -r '.version' ../../lerna.json)
git push --atomic origin main v$(jq -r '.version' ../../lerna.json)
#git push --atomic origin main v$(jq -r '.version' ../../lerna.json)
cd ../../
git add .
git commit -m "chore(versions): 😊 publish v$(jq -r '.version' lerna.json)"
git tag v$(jq -r '.version' lerna.json)
yarn changelog --breaking-pattern "BREAKING CHANGE:"
git add .
git commit -m "chore: update changelog"
git push --atomic origin main v$(jq -r '.version' lerna.json)
#git push --atomic origin main v$(jq -r '.version' lerna.json)

0 comments on commit 03fdee1

Please sign in to comment.