diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f83118d..ec16b64 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,8 +5,12 @@ "extended": true, "version": "0.147.9" }, - "ghcr.io/devcontainers/features/node:1": {} + "ghcr.io/devcontainers/features/node:1": {}, + "ghcr.io/devcontainers/features/ruby:1": { + "version": "3.3" + } }, + "postCreateCommand": "bundle install", "customizations": { "vscode": { "extensions": [ diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..83987e2 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,22 @@ +name: Lint Markdown + +on: + pull_request: + push: + branches: [develop, main] + +jobs: + mdl: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.3" + bundler-cache: true + + - name: Rodar mdl + run: bundle exec mdl content README.md diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..16bc7f8 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,77 @@ +name: Release + +# Roda sempre que develop é mergeada em main (ou qualquer outro push direto +# em main). Gera o CHANGELOG.md (Keep a Changelog) com o git-cliff, cria a +# tag semver automaticamente e publica a GitHub Release com as notas. + +on: + push: + branches: [main] + +permissions: + contents: write + +concurrency: + group: release + cancel-in-progress: false + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Instalar git-cliff + uses: taiki-e/install-action@git-cliff + + - name: Verificar se há algo para lançar + id: release + run: | + LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || true) + NEXT_VERSION=$(git-cliff --bumped-version 2>/dev/null) + + if [ -n "$LAST_TAG" ] && [ "$LAST_TAG" = "$NEXT_VERSION" ]; then + echo "Nada para lançar (nenhum commit relevante desde $LAST_TAG)." + echo "skip=true" >> "$GITHUB_OUTPUT" + else + echo "Próxima versão: $NEXT_VERSION" + echo "skip=false" >> "$GITHUB_OUTPUT" + echo "version=$NEXT_VERSION" >> "$GITHUB_OUTPUT" + fi + + - name: Atualizar CHANGELOG.md + if: steps.release.outputs.skip == 'false' + run: git-cliff --tag "${{ steps.release.outputs.version }}" -o CHANGELOG.md + + - name: Commitar CHANGELOG.md + if: steps.release.outputs.skip == 'false' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add CHANGELOG.md + git commit -m "chore(release): ${{ steps.release.outputs.version }}" + git push origin HEAD:main + + - name: Criar tag + if: steps.release.outputs.skip == 'false' + run: | + git tag "${{ steps.release.outputs.version }}" + git push origin "${{ steps.release.outputs.version }}" + + - name: Gerar notas da release + if: steps.release.outputs.skip == 'false' + run: | + git-cliff --tag "${{ steps.release.outputs.version }}" --latest --strip header \ + -o /tmp/release-notes.md + + - name: Publicar GitHub Release + if: steps.release.outputs.skip == 'false' + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + gh release create "${{ steps.release.outputs.version }}" \ + --title "${{ steps.release.outputs.version }}" \ + --notes-file /tmp/release-notes.md diff --git a/.gitpod.yml b/.gitpod.yml index 8bc7732..9bf6bbc 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -10,6 +10,10 @@ tasks: init: echo "Your version of Hugo is `hugo version`" && hugo mod tidy command: hugo server -D -F --baseURL $(gp url 1313) --liveReloadPort=443 --appendPort=false --bind=0.0.0.0 --disableFastRender + - name: Lint (mdl) + init: bundle install + command: bundle exec mdl content README.md + ports: - port: 1313 onOpen: open-preview diff --git a/.mdl_style.rb b/.mdl_style.rb new file mode 100644 index 0000000..a03394a --- /dev/null +++ b/.mdl_style.rb @@ -0,0 +1,16 @@ +all + +# O