diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml similarity index 51% rename from .github/workflows/test.yml rename to .github/workflows/ci.yml index 557455c9..31d1fd1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Test +name: CI on: push: @@ -13,14 +13,10 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - # Use PAT instead of default Github token, because the default - # token deliberately will not trigger another workflow run - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - uses: actions/setup-node@v3 - with: - node-version: '18.x' + node-version: '20.x' registry-url: 'https://npm.pkg.github.com' - uses: pnpm/action-setup@v2 - name: Install @@ -31,6 +27,6 @@ jobs: run: pnpm build - name: Test run: pnpm test - - name: Tag - if: ${{ github.ref == 'refs/heads/main' }} - run: ./tag.sh + - name: Release + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + run: ./release.sh diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 0035b11e..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Publish - -on: - push: - tags: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: '18.x' - registry-url: 'https://npm.pkg.github.com' - - uses: pnpm/action-setup@v2 - - name: Install - run: pnpm install - - name: Publish - run: cd packages/floating-vue && npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/tag.sh b/release.sh similarity index 94% rename from tag.sh rename to release.sh index 97e23364..c2c98ce4 100755 --- a/tag.sh +++ b/release.sh @@ -24,3 +24,5 @@ git add --all packages/floating-vue/dist/ git commit --message "Release version $VERSION" git tag $VERSION git push origin refs/tags/$VERSION + +npm publish -w packages/floating-vue