diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33828cf8..16e0c65d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v2 with: - version: 7 + version: 8 - name: Set node version to ${{ matrix.node_version }} uses: actions/setup-node@v3 diff --git a/.github/workflows/cq.yml b/.github/workflows/cq.yml index 55ca98de..59e3ea1b 100644 --- a/.github/workflows/cq.yml +++ b/.github/workflows/cq.yml @@ -29,7 +29,7 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v2 with: - version: 7 + version: 8 - name: Set node version to ${{ matrix.node_version }} uses: actions/setup-node@v3 diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index be30ef5c..00000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: End-to-end tests - -on: - workflow_dispatch: - -defaults: - run: - working-directory: . - -jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest] - node_version: [16] - fail-fast: false - name: "End-to-end tests on node-${{ matrix.node_version }}, ${{ matrix.os }}" - steps: - - name: Set node version to ${{ matrix.node_version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node_version }} - - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v5.5 - - - name: Clone - run: npx -y degit cyco130/vavite/examples/ssr-react-express#${{ steps.branch-name.outputs.current_branch }} ssr-react-express - - - name: Install - working-directory: ssr-react-express - run: npm install - - - name: Build - working-directory: ssr-react-express - run: npm run build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..d771ac67 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,63 @@ +name: Publish to NPM + +on: + workflow_dispatch: + inputs: + version: + description: "Version to publish" + required: true + type: "string" + commit: + description: "Should we commit the version bump?" + required: false + type: "boolean" + default: true + +defaults: + run: + working-directory: . + +jobs: + publish: + runs-on: ubuntu-latest + name: "Publish to NPM" + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Set node version to 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: "https://registry.npmjs.org" + cache: "pnpm" + + - name: Install + run: pnpm install + + - name: Set up git user + run: | + git config --global user.name "GitHub Action Bot" + git config --global user.email "<>" + + - name: Bump version + run: "pnpm version ${{ github.event.inputs.version }} --no-git-tag-version" + + - name: "Publish to NPM" + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: pnpm -r publish --access public --no-git-checks + + - name: "Commit version bump" + if: ${{ github.event.inputs.commit == 'true' }} + run: | + git status + git commit -am "release: ${{ github.event.inputs.version }}" + git push + git tag ${{ github.event.inputs.version }} + git push --tags