diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..a5946fbf --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,48 @@ +name: Release + +on: + push: + branches: + - 'main' + +jobs: + release: + if: | + ${{ contains(github.event.head_commit.message, 'chore: release') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: volta-cli/action@v3 + + - uses: pnpm/action-setup@v2 + + - run: pnpm install + + - name: Release + run: | + pnpm run build + + - name: Git commit + id: commit + run: | + git config --local user.email github-actions[bot]@users.noreply.github.com + git config --local user.name github-actions[bot] + git config --global core.autocrlf true + git config --global core.safecrlf false + git add . + git commit -m "CI build" -a + continue-on-error: true + + - name: Git push + uses: ad-m/github-push-action@master + if: ${{ steps.commit.outcome == 'success' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} + + - name: Log + if: ${{ steps.commit.outcome != 'success' }} + run: echo Nothing to commit. diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 00000000..f5eceb6a --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,27 @@ +name: Check + +on: + push: + branches: + - '**' + pull_request: + branches: + - main + +jobs: + check: + runs-on: ubuntu-latest + if: | + ${{ !contains(github.event.head_commit.message, 'chore: release') }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: volta-cli/action@v3 + + - uses: pnpm/action-setup@v2 + + - run: pnpm install + + - run: pnpm run check diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 00000000..6f342afa --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,19 @@ +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v3 + with: + release-type: node + package-name: release-please-action