diff --git a/.github/workflows/publish-gpr.yml b/.github/workflows/publish-gpr.yml new file mode 100644 index 0000000..ec0d8be --- /dev/null +++ b/.github/workflows/publish-gpr.yml @@ -0,0 +1,28 @@ +# https://github.com/actions/create-release +# Create a release if a tag matching v* is pushed + +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + - name: Create Release in github + id: create_release_gpr + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..7bb5298 --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,19 @@ +name: Publish to npm +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v1 + with: + registry-url: 'https://registry.npmjs.org' + - run: yarn + - run: yarn publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}