From 87c7b3c5437b58cc59fb8e25be15e8f6edcdd963 Mon Sep 17 00:00:00 2001 From: Himenon Date: Tue, 11 Aug 2020 15:29:12 +0900 Subject: [PATCH] ci: add release workflow --- .github/workflows/release-workflow.yml | 58 ++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/release-workflow.yml diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml new file mode 100644 index 0000000..2390aee --- /dev/null +++ b/.github/workflows/release-workflow.yml @@ -0,0 +1,58 @@ +name: Release Workflow + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: master + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: | + yarn install --frozen-lockfile + yarn test + yarn build + release-github-npm-registry: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: master + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://npm.pkg.github.com/ + scope: '@Himenon' + - run: | + yarn install --frozen-lockfile + yarn build + echo "//npm.pkg.github.com/:_authToken=$GITHUB_NPM_TOKEN" >> ~/.npmrc + yarn lerna publish from-package --yes --registry https://npm.pkg.github.com/:_authToken=${GITHUB_NPM_TOKEN} + env: + GITHUB_NPM_TOKEN: ${{secrets.GITHUB_NPM_TOKEN}} + release-npm-packages: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: master + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: | + yarn install --frozen-lockfile + yarn build + echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc + yarn lerna publish from-package --yes + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}