From ab2ac7d17e744b595011703c29424710ece8ec7b Mon Sep 17 00:00:00 2001 From: Dohyeong Date: Tue, 23 Nov 2021 14:40:11 +0900 Subject: [PATCH] ci: add 'release' github-actions workflow that is triggering when the new release is created --- .github/workflows/publish.yml | 21 +++++++++++++++++++++ package.json | 1 + 2 files 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 00000000..a685a793 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,21 @@ +name: release + +on: + release: + types: [created] + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm test + - run: npm run build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index e1a51327..29ba260b 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "prepare": "husky install", "prettier": "npx prettier --config .prettierrc --check .", "prettier:fix": "npx prettier --config .prettierrc --write .", + "release": "npx np --no-tests --no-publish", "test": "jest test/*.spec.ts test/**/*.spec.ts", "webpack": "webpack" },