Skip to content

Commit

Permalink
chore: fix 0.2.1 release ci (#404)
Browse files Browse the repository at this point in the history
Signed-off-by: cutecutecat <[email protected]>
  • Loading branch information
cutecutecat authored Mar 4, 2024
1 parent a6acb46 commit 860284c
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,14 @@ permissions:
jobs:
semver:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.semver }}
steps:
- uses: actions/github-script@v7
id: version
with:
script: |
const r = /(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
if (!r.test("${{ github.event.release.tag_name }}")) {
core.setFailed(`invalid semver`);
const r = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
if (!r.test("${{ github.event.inputs.version }}")) {
core.setFailed(`Action failed with an invalid semver.`);
}
const matches = "${{ github.event.release.tag_name }}".match(r);
console.log(matches);
core.setOutput('semver', matches[0]);
binary:
strategy:
matrix:
Expand Down Expand Up @@ -120,7 +114,7 @@ jobs:
push: true
platforms: "linux/${{ matrix.platform }}"
file: ./docker/binary_release.Dockerfile
tags: tensorchord/pgvecto-rs-binary:pg${{ matrix.version }}-v${{ needs.semver.outputs.version }}-${{ matrix.platform }}
tags: tensorchord/pgvecto-rs-binary:pg${{ matrix.version }}-v${{ github.event.inputs.version }}-${{ matrix.platform }}
docker_release:
needs: ["docker_binary_release", "semver"]
runs-on: ubuntu-latest
Expand All @@ -133,13 +127,13 @@ jobs:
uses: actions/checkout@v4
- name: Variables
id: variables
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
if ("${{ matrix.rootless }}" == "true") {
core.setOutput('tags', "tensorchord/pgvecto-rs:pg${{ matrix.version }}-v${{ needs.semver.outputs.version }}-rootless");
core.setOutput('tags', "tensorchord/pgvecto-rs:pg${{ matrix.version }}-v${{ github.event.inputs.version }}-rootless");
} else {
core.setOutput('tags', "tensorchord/pgvecto-rs:pg${{ matrix.version }}-v${{ needs.semver.outputs.version }}");
core.setOutput('tags', "tensorchord/pgvecto-rs:pg${{ matrix.version }}-v${{ github.event.inputs.version }}");
}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -159,7 +153,7 @@ jobs:
platforms: "linux/amd64,linux/arm64"
file: ./docker/pgvecto-rs.Dockerfile
build-args: |
FROM_TAG=pg${{ matrix.version }}-v${{ needs.semver.outputs.version }}
FROM_TAG=pg${{ matrix.version }}-v${{ github.event.inputs.version }}
POSTGRES_VERSION=${{ matrix.version }}
tags: ${{ steps.variables.outputs.tags }}
- name: Push postgres with pgvecto.rs to Docker Registry(rootless)
Expand All @@ -171,6 +165,6 @@ jobs:
platforms: "linux/amd64,linux/arm64"
file: ./docker/pgvecto-rs-rootless.Dockerfile
build-args: |
FROM_TAG=pg${{ matrix.version }}-v${{ needs.semver.outputs.version }}
FROM_TAG=pg${{ matrix.version }}-v${{ github.event.inputs.version }}
POSTGRES_VERSION=${{ matrix.version }}
tags: ${{ steps.variables.outputs.tags }}
tags: ${{ steps.variables.outputs.tags }}

0 comments on commit 860284c

Please sign in to comment.