diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..0035b11e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,24 @@ +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/.github/workflows/release-note.yml b/.github/workflows/release-note.yml deleted file mode 100644 index 33fdb4ec..00000000 --- a/.github/workflows/release-note.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Create release - -permissions: - contents: write - -on: - push: - tags: - - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 - workflow_dispatch: - -jobs: - build: - name: Create Release - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Fetch all tags - - - name: Create Release for Tag - id: release_tag - uses: Akryum/release-tag@v4.0.7 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..557455c9 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,36 @@ +name: Test + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v3 + 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' + registry-url: 'https://npm.pkg.github.com' + - uses: pnpm/action-setup@v2 + - name: Install + run: pnpm install + - name: Lint + run: pnpm lint + - name: Build + run: pnpm build + - name: Test + run: pnpm test + - name: Tag + if: ${{ github.ref == 'refs/heads/main' }} + run: ./tag.sh diff --git a/packages/floating-vue/package.json b/packages/floating-vue/package.json index f874575f..9db0a248 100644 --- a/packages/floating-vue/package.json +++ b/packages/floating-vue/package.json @@ -1,6 +1,6 @@ { - "name": "floating-vue", - "version": "2.0.0-beta.24", + "name": "@reedsy/floating-vue", + "version": "2.0.0-reedsy.1.0.0", "description": "Easy Vue tooltips, dropdowns, menus & popovers using floating-ui", "author": "Guillaume Chau ", "scripts": { @@ -75,7 +75,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "git+https://github.com/Akryum/floating-vue.git", + "url": "git+https://github.com/reedsy/floating-vue.git", "directory": "packages/floating-vue" } } diff --git a/tag.sh b/tag.sh new file mode 100755 index 00000000..48122015 --- /dev/null +++ b/tag.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +VERSION=$(node -p "require('.packages/floating-vue/package.json').version") + +git config --local user.email "github@reedsy.com" +git config --local user.name "GitHub Action" +git fetch --tags + +VERSION_COUNT=$(git tag --list $VERSION | wc -l) + +if [ $VERSION_COUNT -gt 0 ] +then + echo "Version $VERSION already deployed." + exit 0 +else + echo "Deploying version $VERSION" +fi + +echo '!/dist' >> .gitignore + +git checkout -b release-$VERSION +git add .gitignore +git add --all dist/ +git commit --message "Release version $VERSION" +git tag $VERSION +git push origin refs/tags/$VERSION