diff --git a/.github/actions/snapshot-release/action.yml b/.github/actions/snapshot-release/action.yml new file mode 100644 index 0000000..ccb904f --- /dev/null +++ b/.github/actions/snapshot-release/action.yml @@ -0,0 +1,18 @@ +name: Snapshot Release +description: Publish a snapshot release +inputs: + tag: + description: 'The tag to use for the snapshot release' + required: true +runs: + using: 'composite' + steps: + - name: Build + shell: bash + run: pnpm build + - name: Version Snapshot + shell: bash + run: pnpm changeset version --snapshot ${{ inputs.tag }} + - name: Snapshot Publish + shell: bash + run: pnpm changeset publish --tag ${{ inputs.tag }} --no-git-tag diff --git a/.github/workflows/on-demand-release.yml b/.github/workflows/on-demand-release.yml new file mode 100644 index 0000000..c851c73 --- /dev/null +++ b/.github/workflows/on-demand-release.yml @@ -0,0 +1,36 @@ +name: On demand snapshot release +on: + workflow_dispatch: + inputs: + tag: + description: 'The tag to use for the snapshot release' + required: true + +env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} +jobs: + snapshot: + name: Snapshot Release + runs-on: ubuntu-latest + steps: + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v3.x + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + with: + version: 8.2.0 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: 'pnpm' + registry-url: 'https://registry.npmjs.org' + - name: Prepare + run: pnpm i + - name: Publish + uses: ./.github/actions/snapshot-release + with: + tag: ${{ github.event.inputs.tag }} +