From ce8de6d6cdb5b137eec0a13f93f6a8b71322d082 Mon Sep 17 00:00:00 2001 From: Khaazz Date: Sun, 12 Jan 2020 14:32:23 +0100 Subject: [PATCH] CI: publish and test CI scripts --- .github/workflows/publish.yaml | 53 ++++++++++++++++++++++++++++++++++ .github/workflows/test.yaml | 22 ++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .github/workflows/publish.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..400ad67 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,53 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: yarn install + - run: yarn test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - name: Dep install + run: yarn install + - name: Publish + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.npm_token }} + + publish-gpr: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://npm.pkg.github.com/ + scope: '@axonteam' + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Dep install + run: yarn install + - name: Configure .npmrc + run: echo registry=https://npm.pkg.github.com/Axonteam >> .npmrc + - name: Publish + run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..d87a064 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,22 @@ +name: Test + +on: [push] + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x] + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: yarn install and lint + run: | + yarn install + yarn test + env: + CI: true