From bffc607a70c0d2ef377156c9a7610841a74200d5 Mon Sep 17 00:00:00 2001 From: Zikeji Date: Mon, 28 Sep 2020 01:06:58 -0400 Subject: [PATCH] feat: add new github actions --- .github/workflows/publish.yml | 28 +++++++++++++++++++ .github/workflows/tagged-release.yml | 40 ++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/tagged-release.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..514a342 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + - uses: actions/checkout@v2 + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + registry-url: https://registry.npmjs.org/ + - name: Install dependencies + run: npm ci + - name: Run eslint + run: npm run test:lint + - name: Run tests & coverage + run: npm run coverage + env: + BOT_TOKEN: "${{ secrets.BOT_TOKEN }}" + - name: Build + run: npm run build --if-present + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml new file mode 100644 index 0000000..f0e878e --- /dev/null +++ b/.github/workflows/tagged-release.yml @@ -0,0 +1,40 @@ +name: "tagged-release" + +on: + push: + tags: + - "v*" + +jobs: + tagged-release: + name: "Tagged Release" + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + - name: Install dependencies + run: npm ci + - name: Run eslint + run: npm run test:lint + - name: Run tests & coverage + run: npm run coverage + env: + BOT_TOKEN: "${{ secrets.BOT_TOKEN }}" + - name: Build + run: npm run build --if-present + - name: Create Docs + run: npm run docs + - uses: papeloto/action-zip@v1 + with: + files: package.json package-lock.json LICENSE dist/ docs/ + dest: dist.zip + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + LICENSE + dist.zip \ No newline at end of file