Repository navigation
Add allowed item membership #30
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: release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| publish-dry-run: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: | | |
| set -euo pipefail | |
| mkdir -p .cargo | |
| { | |
| echo '[patch.crates-io]' | |
| find packages -name Cargo.toml -not -path '*/target/*' -print0 | | |
| sort -z | | |
| while IFS= read -r -d '' manifest; do | |
| name=$(sed -n 's/^name = "\([^"]*\)"/\1/p' "$manifest" | head -1) | |
| directory=$(dirname "$manifest") | |
| printf '%s = { path = "../%s" }\n' "$name" "${directory#./}" | |
| done | |
| } > .cargo/config.toml | |
| find packages -name Cargo.toml -print0 | | |
| sort -z | | |
| while IFS= read -r -d '' manifest; do | |
| cargo publish --dry-run --manifest-path "$manifest" | |
| done | |
| release-foundations: | |
| needs: publish-dry-run | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| manifest: | |
| - packages/aqc-file-engine-core/Cargo.toml | |
| - packages/aqc-filetree/Cargo.toml | |
| - packages/aqc-fs-utils/Cargo.toml | |
| - packages/aqc-git-helpers/Cargo.toml | |
| - packages/source/rust/aqc-rust-syntax/Cargo.toml | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: release-plz/action@v0.5 | |
| with: | |
| manifest_path: ${{ matrix.manifest }} | |
| config: release-plz.toml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| release-format-cores: | |
| needs: release-foundations | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| manifest: | |
| - packages/file-types/toml/aqc-toml-engine-core/Cargo.toml | |
| - packages/file-types/json/aqc-json-engine-core/Cargo.toml | |
| - packages/file-types/yaml/aqc-yaml-engine-core/Cargo.toml | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Wait for file-engine core on crates.io | |
| run: | | |
| set -euo pipefail | |
| version=$(sed -n 's/^version = "\([^"]*\)"/\1/p' packages/aqc-file-engine-core/Cargo.toml | head -1) | |
| for attempt in $(seq 1 30); do | |
| cargo info "aqc-file-engine-core@$version" >/dev/null 2>&1 && exit 0 | |
| sleep 10 | |
| done | |
| echo "aqc-file-engine-core@$version did not become available" >&2 | |
| exit 1 | |
| - uses: release-plz/action@v0.5 | |
| with: | |
| manifest_path: ${{ matrix.manifest }} | |
| config: release-plz.toml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| release-file-engines: | |
| needs: release-format-cores | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| manifest: | |
| - packages/file-types/text/aqc-text-file-engine/Cargo.toml | |
| - packages/file-types/toml/aqc-cargo-toml-engine/Cargo.toml | |
| - packages/file-types/toml/aqc-clippy-toml-engine/Cargo.toml | |
| - packages/file-types/toml/aqc-deny-toml-engine/Cargo.toml | |
| - packages/file-types/toml/aqc-rust-toolchain-toml-engine/Cargo.toml | |
| - packages/file-types/toml/aqc-rustfmt-toml-engine/Cargo.toml | |
| - packages/file-types/json/aqc-package-json-engine/Cargo.toml | |
| - packages/file-types/json/aqc-json-file-engine/Cargo.toml | |
| - packages/file-types/jsonc/aqc-tsconfig-json-engine/Cargo.toml | |
| - packages/file-types/yaml/aqc-pnpm-workspace-yaml-engine/Cargo.toml | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Wait for engine cores on crates.io | |
| run: | | |
| set -euo pipefail | |
| for manifest in \ | |
| packages/aqc-file-engine-core/Cargo.toml \ | |
| packages/file-types/toml/aqc-toml-engine-core/Cargo.toml \ | |
| packages/file-types/json/aqc-json-engine-core/Cargo.toml \ | |
| packages/file-types/yaml/aqc-yaml-engine-core/Cargo.toml; do | |
| name=$(sed -n 's/^name = "\([^"]*\)"/\1/p' "$manifest" | head -1) | |
| version=$(sed -n 's/^version = "\([^"]*\)"/\1/p' "$manifest" | head -1) | |
| available=false | |
| for attempt in $(seq 1 30); do | |
| if cargo info "$name@$version" >/dev/null 2>&1; then | |
| available=true | |
| break | |
| fi | |
| sleep 10 | |
| done | |
| if [ "$available" != true ]; then | |
| echo "$name@$version did not become available" >&2 | |
| exit 1 | |
| fi | |
| done | |
| - uses: release-plz/action@v0.5 | |
| with: | |
| manifest_path: ${{ matrix.manifest }} | |
| config: release-plz.toml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |