diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..99945de --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +--- +name: Release +on: push + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: make docs + - name: Verify no changes after docs build + run: | + git diff --exit-code + + release-please: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - uses: jimeh/release-please-manifest-action@v1 + id: release + - name: MAJOR and MAJOR.MINOR tags + if: ${{ steps.release.outputs.release_created }} + uses: jimeh/update-tags-action@v1 + with: + tags: | + v${{ steps.release.outputs.major }} + v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 6aeabf9..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: Release -on: - push: - branches: - - main - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: jimeh/release-please-manifest-action@main - id: release - - name: Create/update MAJOR tag - if: ${{ steps.release.outputs.release_created }} - uses: richardsimko/update-tag@v1 - with: - tag_name: v${{ steps.release.outputs.major }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Create/update MAJOR.MINOR tag - if: ${{ steps.release.outputs.release_created }} - uses: richardsimko/update-tag@v1 - with: - tag_name: v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index c3f277e..8bafe03 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,10 @@ +.PHONY: docs +docs: readme + +.PHONY: readme +readme: check-npx action-docs + npx --yes prettier --print-width 80 --prose-wrap always --write README.md + .PHONY: action-docs action-docs: check-npx npx --yes action-docs --update-readme