diff --git a/.github/workflows/publish-edgedb-auth.yaml b/.github/workflows/publish-edgedb-auth.yaml index 5dc3efbb..1e3a491f 100644 --- a/.github/workflows/publish-edgedb-auth.yaml +++ b/.github/workflows/publish-edgedb-auth.yaml @@ -13,25 +13,30 @@ jobs: id-token: "write" contents: "read" steps: - # checkout and env setup - - uses: actions/checkout@v3 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/flakehub-cache-action@main - - name: Build the nix shell - run: nix develop --command just --version + - name: checkout and env setup + uses: actions/checkout@v3 - # test - - name: Test - run: nix develop --command just test + - name: Extract project name and version + run: | + set -x + PROJECT_NAME=$(echo $GITHUB_REF | sed -E 's|refs/tags/releases/([^/]+)/v.*|\1|') + VERSION=$(echo $GITHUB_REF | sed -E 's|.*/v(.*)|\1|') + echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV + echo "VERSION=$VERSION" >> $GITHUB_ENV # verify that git tag matches cargo version - run: | set -x cargo_version="$(cargo metadata --format-version 1 \ - | jq -r '.packages[] | select(.name=="gel-auth") | .version')" - tag_version="${GITHUB_REF#refs/tags/releases/gel-auth/v}" - test "$cargo_version" = "$tag_version" + | jq -r '.packages[] | select(.name==$PROJECT_NAME) | .version')" + test "$cargo_version" = "$VERSION" + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt, clippy - - working-directory: ./gel-auth + - working-directory: ./${{ env.PROJECT_NAME }} run: | - nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} + cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/publish-edgedb-derive.yaml b/.github/workflows/publish-edgedb-derive.yaml index 3e214bf2..2452482c 100644 --- a/.github/workflows/publish-edgedb-derive.yaml +++ b/.github/workflows/publish-edgedb-derive.yaml @@ -13,25 +13,30 @@ jobs: id-token: "write" contents: "read" steps: - # checkout and env setup - - uses: actions/checkout@v3 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/flakehub-cache-action@main - - name: Build the nix shell - run: nix develop --command just --version + - name: checkout and env setup + uses: actions/checkout@v3 - # test - - name: Test - run: nix develop --command just test + - name: Extract project name and version + run: | + set -x + PROJECT_NAME=$(echo $GITHUB_REF | sed -E 's|refs/tags/releases/([^/]+)/v.*|\1|') + VERSION=$(echo $GITHUB_REF | sed -E 's|.*/v(.*)|\1|') + echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV + echo "VERSION=$VERSION" >> $GITHUB_ENV # verify that git tag matches cargo version - run: | set -x cargo_version="$(cargo metadata --format-version 1 \ - | jq -r '.packages[] | select(.name=="gel-derive") | .version')" - tag_version="${GITHUB_REF#refs/tags/releases/gel-derive/v}" - test "$cargo_version" = "$tag_version" + | jq -r '.packages[] | select(.name==$PROJECT_NAME) | .version')" + test "$cargo_version" = "$VERSION" + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt, clippy - - working-directory: ./gel-derive + - working-directory: ./${{ env.PROJECT_NAME }} run: | - nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} + cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/publish-edgedb-errors.yaml b/.github/workflows/publish-edgedb-errors.yaml index 666bdeb5..8f4824c3 100644 --- a/.github/workflows/publish-edgedb-errors.yaml +++ b/.github/workflows/publish-edgedb-errors.yaml @@ -13,25 +13,30 @@ jobs: id-token: "write" contents: "read" steps: - # checkout and env setup - - uses: actions/checkout@v3 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/flakehub-cache-action@main - - name: Build the nix shell - run: nix develop --command cargo --version + - name: checkout and env setup + uses: actions/checkout@v3 - # test - - name: Test - run: nix develop --command just test + - name: Extract project name and version + run: | + set -x + PROJECT_NAME=$(echo $GITHUB_REF | sed -E 's|refs/tags/releases/([^/]+)/v.*|\1|') + VERSION=$(echo $GITHUB_REF | sed -E 's|.*/v(.*)|\1|') + echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV + echo "VERSION=$VERSION" >> $GITHUB_ENV # verify that git tag matches cargo version - run: | set -x cargo_version="$(cargo metadata --format-version 1 \ - | jq -r '.packages[] | select(.name=="gel-errors") | .version')" - tag_version="${GITHUB_REF#refs/tags/releases/gel-errors/v}" - test "$cargo_version" = "$tag_version" + | jq -r '.packages[] | select(.name==$PROJECT_NAME) | .version')" + test "$cargo_version" = "$VERSION" + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt, clippy - - working-directory: ./gel-errors + - working-directory: ./${{ env.PROJECT_NAME }} run: | - nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} + cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/publish-edgedb-protocol.yaml b/.github/workflows/publish-edgedb-protocol.yaml index f1d37354..f65c4d88 100644 --- a/.github/workflows/publish-edgedb-protocol.yaml +++ b/.github/workflows/publish-edgedb-protocol.yaml @@ -13,25 +13,30 @@ jobs: id-token: "write" contents: "read" steps: - # checkout and env setup - - uses: actions/checkout@v3 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/flakehub-cache-action@main - - name: Build the nix shell - run: nix develop --command just --version + - name: checkout and env setup + uses: actions/checkout@v3 - # test - - name: Test - run: nix develop --command just test + - name: Extract project name and version + run: | + set -x + PROJECT_NAME=$(echo $GITHUB_REF | sed -E 's|refs/tags/releases/([^/]+)/v.*|\1|') + VERSION=$(echo $GITHUB_REF | sed -E 's|.*/v(.*)|\1|') + echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV + echo "VERSION=$VERSION" >> $GITHUB_ENV # verify that git tag matches cargo version - run: | set -x cargo_version="$(cargo metadata --format-version 1 \ - | jq -r '.packages[] | select(.name=="gel-protocol") | .version')" - tag_version="${GITHUB_REF#refs/tags/releases/gel-protocol/v}" - test "$cargo_version" = "$tag_version" + | jq -r '.packages[] | select(.name==$PROJECT_NAME) | .version')" + test "$cargo_version" = "$VERSION" + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt, clippy - - working-directory: ./gel-protocol + - working-directory: ./${{ env.PROJECT_NAME }} run: | - nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} + cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/publish-edgedb-stream.yaml b/.github/workflows/publish-edgedb-stream.yaml index 8ab9e265..3fa0b82a 100644 --- a/.github/workflows/publish-edgedb-stream.yaml +++ b/.github/workflows/publish-edgedb-stream.yaml @@ -13,25 +13,30 @@ jobs: id-token: "write" contents: "read" steps: - # checkout and env setup - - uses: actions/checkout@v3 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/flakehub-cache-action@main - - name: Build the nix shell - run: nix develop --command just --version + - name: checkout and env setup + uses: actions/checkout@v3 - # test - - name: Test - run: nix develop --command just test + - name: Extract project name and version + run: | + set -x + PROJECT_NAME=$(echo $GITHUB_REF | sed -E 's|refs/tags/releases/([^/]+)/v.*|\1|') + VERSION=$(echo $GITHUB_REF | sed -E 's|.*/v(.*)|\1|') + echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV + echo "VERSION=$VERSION" >> $GITHUB_ENV # verify that git tag matches cargo version - run: | set -x cargo_version="$(cargo metadata --format-version 1 \ - | jq -r '.packages[] | select(.name=="gel-stream") | .version')" - tag_version="${GITHUB_REF#refs/tags/releases/gel-stream/v}" - test "$cargo_version" = "$tag_version" + | jq -r '.packages[] | select(.name==$PROJECT_NAME) | .version')" + test "$cargo_version" = "$VERSION" + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt, clippy - - working-directory: ./gel-stream + - working-directory: ./${{ env.PROJECT_NAME }} run: | - nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} + cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/publish-edgedb-tokio.yaml b/.github/workflows/publish-edgedb-tokio.yaml index 64a5c594..5bae69d3 100644 --- a/.github/workflows/publish-edgedb-tokio.yaml +++ b/.github/workflows/publish-edgedb-tokio.yaml @@ -13,26 +13,30 @@ jobs: id-token: "write" contents: "read" steps: - # checkout and env setup - - uses: actions/checkout@v3 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/flakehub-cache-action@main - - name: Build the nix shell - run: nix build '.#devShells.x86_64-linux.default' + - name: checkout and env setup + uses: actions/checkout@v3 - # test - - name: Test - run: nix develop --command just test + - name: Extract project name and version + run: | + set -x + PROJECT_NAME=$(echo $GITHUB_REF | sed -E 's|refs/tags/releases/([^/]+)/v.*|\1|') + VERSION=$(echo $GITHUB_REF | sed -E 's|.*/v(.*)|\1|') + echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV + echo "VERSION=$VERSION" >> $GITHUB_ENV # verify that git tag matches cargo version - run: | set -x cargo_version="$(cargo metadata --format-version 1 \ - | jq -r '.packages[] | select(.name=="gel-tokio") | .version')" - tag_version="${GITHUB_REF#refs/tags/releases/gel-tokio/v}" - test "$cargo_version" = "$tag_version" + | jq -r '.packages[] | select(.name==$PROJECT_NAME) | .version')" + test "$cargo_version" = "$VERSION" + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt, clippy - # publish - - working-directory: ./gel-tokio + - working-directory: ./${{ env.PROJECT_NAME }} run: | - nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} + cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}