diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e114190 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Publish new release + +on: + release: + types: [ published ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.release.target_commitish }} + - name: Use Node.js 12 + uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: git config --global user.name "GitHub CD bot" + - run: git config --global user.email "github-cd-bot@github.com" + - run: npm version ${{ github.event.release.tag_name }} + - run: npm run build + # - run: npm test + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - run: git push + env: + github-token: ${{ secrets.GITHUB_TOKEN }}