diff --git a/.github/workflows/release-convert.yaml b/.github/workflows/release-convert.yaml index c364439..5e39b20 100644 --- a/.github/workflows/release-convert.yaml +++ b/.github/workflows/release-convert.yaml @@ -1,4 +1,6 @@ on: + release: + types: [published, edited] workflow_dispatch: name: Release extism-convert @@ -10,6 +12,21 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + ref: '${{ github.ref }}' + + - name: Set version + shell: bash + run: | + version="${{ github.ref }}" + if [[ "$version" = "refs/heads/main" ]]; then + version="0.0.0-dev" + else + version="${version/refs\/tags\/v/}" + fi + sed -i -e "s/0.0.0+replaced-by-ci/${version}/g" Cargo.toml + pyproject="$(cat extism-maturin/pyproject.toml)" + <<<"$pyproject" >extism-maturin/pyproject.toml sed -e 's/^version = "0.0.0.replaced-by-ci"/version = "'"$version"'"/g' - name: Setup Rust env uses: actions-rs/toolchain@v1 @@ -23,4 +40,4 @@ jobs: env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_API_TOKEN }} run: | - cargo publish --manifest-path convert/Cargo.toml + cargo publish --manifest-path convert/Cargo.toml --allow-dirty diff --git a/.github/workflows/release-manifest.yaml b/.github/workflows/release-manifest.yaml index d542664..73760bb 100644 --- a/.github/workflows/release-manifest.yaml +++ b/.github/workflows/release-manifest.yaml @@ -1,4 +1,6 @@ on: + release: + types: [published, edited] workflow_dispatch: name: Release extism-manifest @@ -10,6 +12,21 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + ref: '${{ github.ref }}' + + - name: Set version + shell: bash + run: | + version="${{ github.ref }}" + if [[ "$version" = "refs/heads/main" ]]; then + version="0.0.0-dev" + else + version="${version/refs\/tags\/v/}" + fi + sed -i -e "s/0.0.0+replaced-by-ci/${version}/g" Cargo.toml + pyproject="$(cat extism-maturin/pyproject.toml)" + <<<"$pyproject" >extism-maturin/pyproject.toml sed -e 's/^version = "0.0.0.replaced-by-ci"/version = "'"$version"'"/g' - name: Setup Rust env uses: actions-rs/toolchain@v1 @@ -23,4 +40,4 @@ jobs: env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_API_TOKEN }} run: | - cargo publish --manifest-path manifest/Cargo.toml + cargo publish --manifest-path manifest/Cargo.toml --allow-dirty diff --git a/.github/workflows/release-rust.yaml b/.github/workflows/release-rust.yaml index f4067af..d58fd5e 100644 --- a/.github/workflows/release-rust.yaml +++ b/.github/workflows/release-rust.yaml @@ -1,4 +1,6 @@ on: + release: + types: [published, edited] workflow_dispatch: name: Release Runtime/Rust SDK @@ -10,6 +12,21 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + ref: '${{ github.ref }}' + + - name: Set version + shell: bash + run: | + version="${{ github.ref }}" + if [[ "$version" = "refs/heads/main" ]]; then + version="0.0.0-dev" + else + version="${version/refs\/tags\/v/}" + fi + sed -i -e "s/0.0.0+replaced-by-ci/${version}/g" Cargo.toml + pyproject="$(cat extism-maturin/pyproject.toml)" + <<<"$pyproject" >extism-maturin/pyproject.toml sed -e 's/^version = "0.0.0.replaced-by-ci"/version = "'"$version"'"/g' - name: Setup Rust env uses: actions-rs/toolchain@v1 @@ -23,4 +40,4 @@ jobs: env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_API_TOKEN }} run: | - cargo publish --manifest-path runtime/Cargo.toml + cargo publish --manifest-path runtime/Cargo.toml --allow-dirty diff --git a/extism-maturin/Cargo.toml b/extism-maturin/Cargo.toml index ddf526e..138637e 100644 --- a/extism-maturin/Cargo.toml +++ b/extism-maturin/Cargo.toml @@ -1,11 +1,13 @@ [package] name = "extism-sys" edition.workspace = true -authors.workspace = true license.workspace = true homepage.workspace = true repository.workspace = true version.workspace = true +# Explicitly omit authors from this package since our Cargo "authors" are +# incompatible with PyPI's requirements. +# authors.workspace = true [lib] name = "extism_sys"