chore: add standard .gitattributes for consistent line endings #37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Pre-release | |
| on: | |
| push: | |
| branches: [main] | |
| # Skip pre-release for changes that don't affect the built artifact. | |
| paths-ignore: | |
| - '**.md' | |
| - '.github/dependabot.yml' | |
| - '.github/ISSUE_TEMPLATE/**' | |
| - '.github/PULL_REQUEST_TEMPLATE/**' | |
| - '.coderabbit.yaml' | |
| - '.gitleaks.toml' | |
| - '.pre-commit-config.yaml' | |
| - '.yamllint.yml' | |
| - '.gitignore' | |
| - 'LICENSE' | |
| permissions: | |
| contents: write | |
| jobs: | |
| prerelease: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24.14.0 | |
| cache: npm | |
| - name: Get current version | |
| id: version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Get next pre-release number | |
| id: prerelease | |
| env: | |
| BASE_VERSION: ${{ steps.version.outputs.version }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| REPO: ${{ github.repository }} | |
| run: | | |
| # Derive the next number from existing RELEASES (incl. drafts + already | |
| # published immutable releases), NOT git tags. Under immutable releases a | |
| # pre-release tag can be permanently reserved in the release ledger while | |
| # never materializing as a git ref, so git-tag-based numbering collides on | |
| # the same number every run. The releases list always reflects burned tags. | |
| LATEST=$(gh api "repos/${REPO}/releases" --paginate \ | |
| --jq ".[].tag_name | select(startswith(\"v${BASE_VERSION}-pre.\"))" \ | |
| | sed "s|^v${BASE_VERSION}-pre.||" | sort -n | tail -n1) | |
| if [ -z "$LATEST" ]; then | |
| NUM=1 | |
| else | |
| NUM=$((LATEST + 1)) | |
| fi | |
| TAG="v${BASE_VERSION}-pre.${NUM}" | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| - run: npm ci | |
| - run: npm run build | |
| - run: cp dist/index.html docker-compose-debugger.html | |
| # The repo has immutable releases enabled. softprops/action-gh-release | |
| # creates and publishes in one step, which means the asset upload races | |
| # against the immutable lockdown and fails. Create as draft, upload the | |
| # asset, then publish in a follow-up step. | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.prerelease.outputs.tag }} | |
| files: docker-compose-debugger.html | |
| generate_release_notes: true | |
| prerelease: true | |
| draft: true | |
| - name: Publish pre-release | |
| env: | |
| TAG: ${{ steps.prerelease.outputs.tag }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh release edit "$TAG" --repo "${{ github.repository }}" --draft=false |