diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml deleted file mode 100644 index b5aeeb3..0000000 --- a/.github/workflows/check-dist.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Check dist/ - -on: - push: - branches: - - main - paths-ignore: - - "**.md" - pull_request: - paths-ignore: - - "**.md" - workflow_dispatch: - -jobs: - check-dist: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - cache: yarn - - - run: yarn install --frozen-lockfile - - - run: yarn release - - - run: | - if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then - echo "Detected uncommitted changes after build. See status below:" - git diff - exit 1 - fi - id: diff - - # If index.js was different than expected, upload the expected version as an artifact - - uses: actions/upload-artifact@v4 - if: ${{ failure() && steps.diff.conclusion == 'failure' }} - with: - name: dist - path: dist/ diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml new file mode 100644 index 0000000..7ef8c93 --- /dev/null +++ b/.github/workflows/dist.yml @@ -0,0 +1,43 @@ +name: Release dist/ + +on: + push: + branches: + - main + paths-ignore: + - "**.md" + pull_request: + paths-ignore: + - "**.md" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: write + +jobs: + check-dist: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: yarn + + - run: yarn install --frozen-lockfile + + - run: yarn release + + - run: | + git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} + git config --local user.name "github-actions[bot]" + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git add . + git diff --staged --quiet || git commit -m 'build(dist): package release' + git push