From 10510a4837bc7235d8de8810595f8bcab4f9f61a Mon Sep 17 00:00:00 2001 From: AbigailDeng Date: Tue, 23 Jul 2024 09:57:37 +0800 Subject: [PATCH 1/2] feat: lint, bump tag, publish --- .github/workflows/publish.yml | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 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 0000000..3efe1b6 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,45 @@ +name: publish +env: + CI: true +on: + push: + branches: + - master + tags: + - '!*' +jobs: + release: + name: Setup + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + - name: setup Node + uses: actions/setup-node@v2 + with: + node-version: 18.x + registry-url: 'https://npm.pkg.github.com' + - name: install + run: yarn install + - name: lint + run: npm lint + # Publish to npm if this version is not published + - name: publish + run: | + npx can-npm-publish --verbose + npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN + npm publish || (echo "npm publish failed" && exit 1) + env: + NPM_TOKEN: ${{secrets.NPM_TOKEN}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Push tag to GitHub if package.json version's tag is not tagged + - name: package-version + run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV + - name: package-version-to-git-tag + uses: pkgdeps/git-tag-action@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + github_repo: ${{ github.repository }} + version: ${{ env.PACKAGE_VERSION }} + git_commit_sha: ${{ github.sha }} + git_tag_prefix: 'v' From c76c3a34d8128e657d27b53af8a9dbd1f8973846 Mon Sep 17 00:00:00 2001 From: AbigailDeng Date: Tue, 23 Jul 2024 10:00:46 +0800 Subject: [PATCH 2/2] feat: tag --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eba6908..f47881c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aelf-command", - "version": "0.1.47-beta.5", + "version": "0.1.47-beta.6", "description": "A CLI tools for AElf", "main": "src/index.js", "type": "module",