diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 7378f91..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Create Relase & Publish Package -on: - push: - tags: - - 'v*' -jobs: - build: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false - - uses: aboutbits/github-actions-node/setup-and-install@v2 - with: - node-version: 16 - registry-url: 'https://registry.npmjs.org' - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ad8758b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Create Relase & Publish Package + +on: + push: + tags: + - 'v*' + +env: + NODE_VERSION: 16 + +jobs: + build: + runs-on: ubuntu-22.04 + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - uses: actions/github-script@v6 + with: + script: | + github.rest.repos.createRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: '${{ github.ref }}', + name: 'Release ${{ github.ref_name }}' + }) + - uses: aboutbits/github-actions-node/setup-and-install@v1 + with: + node-version: ${{ env.NODE_VERSION }} + registry-url: 'https://registry.npmjs.org' + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}