From 604b7912e2026782ef9ec27dec401568dc62e5eb Mon Sep 17 00:00:00 2001 From: herablog Date: Mon, 17 Aug 2020 17:07:12 +0900 Subject: [PATCH 1/6] chore(spindle-icons): prepare publishing --- packages/spindle-icons/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/spindle-icons/package.json b/packages/spindle-icons/package.json index 1c934dab5..c406a4f2d 100644 --- a/packages/spindle-icons/package.json +++ b/packages/spindle-icons/package.json @@ -1,6 +1,6 @@ { "name": "@openameba/spindle-icons", - "version": "0.1.0", + "version": "0.0.1", "scripts": { "clean": "npx rimraf dist", "mkdir": "npx mkdirp dist", @@ -16,6 +16,9 @@ "files": [ "dist" ], + "publishConfig": { + "access": "public" + }, "devDependencies": { "@types/cli-progress": "^3.7.0", "axios": "^0.19.2", From 6c439ce03c2e613e2d1faa042a63951eda324280 Mon Sep 17 00:00:00 2001 From: herablog Date: Mon, 17 Aug 2020 17:03:08 +0900 Subject: [PATCH 2/6] chore: create workflow for versioning --- .github/workflows/version.yml | 36 +++++++++++++++++++++++++++++++++++ lerna.json | 8 +++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/version.yml diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml new file mode 100644 index 000000000..c766bffb6 --- /dev/null +++ b/.github/workflows/version.yml @@ -0,0 +1,36 @@ +name: versioning + +on: + push: + branches: + - version/major + - version/minor + - version/patch + - version/premajor + - version/preminor + - version/prepatch + - version/prerelease + +jobs: + version: + name: versioning + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2-beta + with: + node-version: 14 + - name: Set git user + run: | + # TODO: replace this with system user + git config user.email "${{ secrets.GIT_EMAIL }}" + git config user.name "${{ secrets.GIT_NAME }}" + - name: Extract version from branch name + shell: bash + run: echo "##[set-output name=version;]$(echo ${GITHUB_REF##*/})" + id: extract_version + - name: Versioning with lerna + # also see some options in lerna.json + run: npx lerna version ${{ steps.extract_version.outputs.version }} --conventional-commits --create-release github --yes --no-private + env: + GH_TOKEN: ${{ github.token }} diff --git a/lerna.json b/lerna.json index 0d7955c8e..3e40056bc 100644 --- a/lerna.json +++ b/lerna.json @@ -4,5 +4,11 @@ "version": "independent", "packages": [ "packages/*" - ] + ], + "command": { + "version": { + "message": "chore(release): publish", + "allowBranch": "version/*" + } + } } From 161fb1a6b9ed9befe4cc35fa21eaea82cc1316f5 Mon Sep 17 00:00:00 2001 From: herablog Date: Mon, 17 Aug 2020 17:03:23 +0900 Subject: [PATCH 3/6] chore: create workflow for publishing --- .github/workflows/publish.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..01a341e5a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,22 @@ +name: publishing + +on: + push: + tags: + - '@openameba/*' + +jobs: + publish: + name: publishing + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2-beta + with: + node-version: 14 + - name: Log in to npm + run: | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + npm whoami + - name: Publishing with lerna + run: npx lerna publish from-git From e98a50b3702fcdb5d155fe516d6814aeb3c6cb04 Mon Sep 17 00:00:00 2001 From: herablog Date: Tue, 18 Aug 2020 11:53:08 +0900 Subject: [PATCH 4/6] refactor: improve script extracting version --- .github/workflows/version.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index c766bffb6..e4bbf6459 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -26,8 +26,7 @@ jobs: git config user.email "${{ secrets.GIT_EMAIL }}" git config user.name "${{ secrets.GIT_NAME }}" - name: Extract version from branch name - shell: bash - run: echo "##[set-output name=version;]$(echo ${GITHUB_REF##*/})" + run: echo "::set-output name=version::$(echo ${GITHUB_REF##*/})" id: extract_version - name: Versioning with lerna # also see some options in lerna.json From 593243706b8e055227f29a849cfb69f43cb9f7d7 Mon Sep 17 00:00:00 2001 From: herablog Date: Tue, 18 Aug 2020 12:09:29 +0900 Subject: [PATCH 5/6] refactor: update git config for versioning --- .github/workflows/version.yml | 5 ++--- packages/spindle-icons/package.json | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index e4bbf6459..7eea681b5 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -22,9 +22,8 @@ jobs: node-version: 14 - name: Set git user run: | - # TODO: replace this with system user - git config user.email "${{ secrets.GIT_EMAIL }}" - git config user.name "${{ secrets.GIT_NAME }}" + git config --global user.email "<>" + git config --global user.name "openameba" - name: Extract version from branch name run: echo "::set-output name=version::$(echo ${GITHUB_REF##*/})" id: extract_version diff --git a/packages/spindle-icons/package.json b/packages/spindle-icons/package.json index c406a4f2d..506d09814 100644 --- a/packages/spindle-icons/package.json +++ b/packages/spindle-icons/package.json @@ -16,6 +16,7 @@ "files": [ "dist" ], + "private": true, "publishConfig": { "access": "public" }, From c8bb67d469c4445168efacf10983b1ee988a4bdd Mon Sep 17 00:00:00 2001 From: herablog Date: Tue, 18 Aug 2020 13:39:38 +0900 Subject: [PATCH 6/6] chore(spindle-icons): make public --- packages/spindle-icons/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/spindle-icons/package.json b/packages/spindle-icons/package.json index 506d09814..c406a4f2d 100644 --- a/packages/spindle-icons/package.json +++ b/packages/spindle-icons/package.json @@ -16,7 +16,6 @@ "files": [ "dist" ], - "private": true, "publishConfig": { "access": "public" },