diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..b84dfcf --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,18 @@ +name: Publish Package to npmjs +on: + push: + branches: [main] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 14 + registry-url: 'https://registry.npmjs.org' + - run: yarn version --new-version patch + - run: yarn + - run: yarn publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..0e35517 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,21 @@ +name: Publish Package to npmjs +on: + push: + tags: ['*'] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Create release + uses: actions/github-script@v5 + with: + github-token: ${{ github.token }} + script: | + github.rest.repos.createRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: "${{ env.TAG }}", + generate_release_notes: true + })