diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..82c908a --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,21 @@ +name: Setup +description: Perform standard setup and install dependencies using pnpm. +inputs: + node-version: + description: The version of Node.js to install + required: true + default: 20.14.0 + +runs: + using: composite + steps: + - name: Install pnpm + uses: pnpm/action-setup@v3 + - name: Install node + uses: actions/setup-node@v4 + with: + cache: pnpm + node-version: ${{ inputs.node-version }} + - name: Install dependencies + shell: bash + run: pnpm install diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..d5471b7 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,29 @@ +name: Check +on: + workflow_dispatch: + pull_request: + branches: [main] + push: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + actions: write # Necessary to cancel workflow executions + checks: write # Necessary to write reports + pull-requests: write # Necessary to comment on PRs + contents: read + packages: write + +jobs: + build: + name: Build + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + uses: ./.github/actions/setup + - run: pnpm build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0ce1a70 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release +on: + push: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + +permissions: + actions: write # Necessary to cancel workflow executions + checks: write # Necessary to write reports + pull-requests: write # Necessary to comment on PRs + contents: read + packages: write + +jobs: + release: + name: Release + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: write + id-token: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + uses: ./.github/actions/setup + # - name: Create Release Pull Request or Publish + # uses: changesets/action@v1 + # with: + # version: pnpm changeset-version + # publish: pnpm changeset-publish + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 0000000..e559e8f --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,27 @@ +name: Snapshot +on: + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + actions: write # Necessary to cancel workflow executions + checks: write # Necessary to write reports + pull-requests: write # Necessary to comment on PRs + contents: read + packages: write + +jobs: + snapshot: + name: Snapshot + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + uses: ./.github/actions/setup + - name: Build package + run: pnpm build + - name: Create snapshot + id: snapshot + run: pnpx pkg-pr-new publish --pnpm --comment=off