From 357cb38c46aeee41c704b70456a19b2feb668ea7 Mon Sep 17 00:00:00 2001 From: bcaglayan <86224476+bcaglayan@users.noreply.github.com> Date: Thu, 24 Mar 2022 15:42:21 +0300 Subject: [PATCH] GH workflow release package (#334) * GH workflow release package * Decrease node version to v10.x --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..0b674437 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: release + +on: + workflow_dispatch: + inputs: + version_scale: + type: choice + description: Release Scale + options: + - patch + - minor + - major + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.THUNDRA_GITHUB_ACCESS_TOKEN }} + - name: Configure Git User + run: | + git config --global user.email "action@github.com" + git config --global user.name "GitHub Action" + - name: Use Node.js 10.x + uses: actions/setup-node@v2 + with: + node-version: "10.x" + registry-url: https://registry.npmjs.org + + - name: NPM Release + run: npm run release + env: + RELEASE_SCALE: ${{ github.event.inputs.version_scale }} + NODE_AUTH_TOKEN: ${{ secrets.THUNDRA_NPM_API_KEY }} + GITHUB_TOKEN: ${{ secrets.THUNDRA_GITHUB_ACCESS_TOKEN }} diff --git a/package.json b/package.json index a7757444..72f6b40d 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "lint": "tslint --project tsconfig.json -t stylish", "release-minor": "npm install; npm run build; release-it minor --ci --git.commit --git.push --git.tag --git.tagName='v${version}' --github.release --no-git.requireCleanWorkingDir --no-git.requireUpstream --npm.publish", "release-minor-without-tag": "npm install; npm run build; release-it minor --ci --no-git.commit --no-git.push --no-git.tag --no-git.tagName='v${version}' --no-git.requireCleanWorkingDir --no-git.requireUpstream --no-github.release --npm.publish", - "release": "npm install; npm run build; release-it --ci --git.commit --git.push --git.tag --git.tagName='v${version}' --github.release --no-git.requireCleanWorkingDir --no-git.requireUpstream --npm.publish", + "release": "npm install; npm run build; release-it ${RELEASE_SCALE} --ci --git.commit --git.push --git.tag --git.tagName='v${version}' --github.release --no-git.requireCleanWorkingDir --no-git.requireUpstream --npm.publish", "release-without-tag": "npm install; npm run build; release-it --ci --no-git.commit --no-git.push --no-git.tag --no-git.tagName='v${version}' --no-github.release --no-git.requireCleanWorkingDir --no-git.requireUpstream --npm.publish", "release-dry-run": "npm install; npm run build; release-it minor --dry-run --ci --no-git.commit --no-git.push --no-git.tag --no-git.tagName='v${version}' --no-git.requireCleanWorkingDir --no-git.requireUpstream --no-github.release --no-npm.publish" },