77
88permissions :
99 contents : write
10- id-token : write
1110
1211concurrency :
1312 group : release-${{ github.ref }}
@@ -34,13 +33,35 @@ jobs:
3433 run : |
3534 VERSION="${GITHUB_REF_NAME#v}"
3635 echo "VERSION=$VERSION" >> "$GITHUB_ENV"
36+
37+ # Bump crate versions
38+ sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm-util/Cargo.toml
3739 sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm-pipeline-ir/Cargo.toml
3840 sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm-plugin-protocol/Cargo.toml
41+ sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm-plugin-cloud/Cargo.toml
3942 sed -i "0,/version = \"0.0.0-dev\"/s//version = \"$VERSION\"/" crates/hm/Cargo.toml
43+
44+ # Rewrite workspace.dependencies pins so dependents resolve to the
45+ # tagged version (cargo publish strips path deps; the version field
46+ # is what consumers will receive).
47+ sed -i "s|hm-util = { path = \"crates/hm-util\", version = \"0.0.0-dev\" }|hm-util = { path = \"crates/hm-util\", version = \"$VERSION\" }|" Cargo.toml
4048 sed -i "s|hm-pipeline-ir = { path = \"crates/hm-pipeline-ir\", version = \"0.0.0-dev\" }|hm-pipeline-ir = { path = \"crates/hm-pipeline-ir\", version = \"$VERSION\" }|" Cargo.toml
4149 sed -i "s|hm-plugin-protocol = { path = \"crates/hm-plugin-protocol\", version = \"0.0.0-dev\" }|hm-plugin-protocol = { path = \"crates/hm-plugin-protocol\", version = \"$VERSION\" }|" Cargo.toml
50+ sed -i "s|hm-plugin-cloud = { path = \"crates/hm-plugin-cloud\", version = \"0.0.0-dev\" }|hm-plugin-cloud = { path = \"crates/hm-plugin-cloud\", version = \"$VERSION\" }|" Cargo.toml
51+
4252 cargo check --workspace --exclude hm-fixtures
4353
54+ - name : Publish hm-util
55+ run : |
56+ if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/hm-util/$VERSION" > /dev/null 2>&1; then
57+ echo "hm-util@$VERSION already published, skipping"
58+ else
59+ cargo publish -p hm-util --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty
60+ fi
61+
62+ - name : Wait for crates.io index
63+ run : sleep 30
64+
4465 - name : Publish hm-pipeline-ir
4566 run : |
4667 if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/hm-pipeline-ir/$VERSION" > /dev/null 2>&1; then
6384 - name : Wait for crates.io index
6485 run : sleep 30
6586
87+ - name : Publish hm-plugin-cloud
88+ run : |
89+ if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/hm-plugin-cloud/$VERSION" > /dev/null 2>&1; then
90+ echo "hm-plugin-cloud@$VERSION already published, skipping"
91+ else
92+ cargo publish -p hm-plugin-cloud --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty
93+ fi
94+
95+ - name : Wait for crates.io index
96+ run : sleep 30
97+
6698 - name : Publish harmont-cli
6799 run : |
68100 if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/harmont-cli/$VERSION" > /dev/null 2>&1; then
@@ -71,48 +103,6 @@ jobs:
71103 cargo publish -p harmont-cli --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty
72104 fi
73105
74- pypi-publish :
75- name : Publish to PyPI
76- runs-on : ubuntu-latest
77- timeout-minutes : 30
78- environment :
79- name : release
80- url : https://pypi.org/project/harmont/
81- permissions :
82- id-token : write
83- steps :
84- - uses : actions/checkout@v4
85-
86- - uses : actions/setup-python@v5
87- with :
88- python-version : " 3.12"
89-
90- - name : Set version from tag
91- run : |
92- VERSION="${GITHUB_REF_NAME#v}"
93- echo "VERSION=$VERSION" >> "$GITHUB_ENV"
94- sed -i '0,/version = "0.0.0-dev"/s//version = "'"$VERSION"'"/' dsls/harmont-py/pyproject.toml
95- grep -n "^version" dsls/harmont-py/pyproject.toml
96-
97- - name : Install build
98- run : python -m pip install --upgrade build
99-
100- - name : Build sdist and wheel
101- working-directory : dsls/harmont-py
102- run : python -m build
103-
104- - name : Inspect dist
105- working-directory : dsls/harmont-py
106- run : |
107- ls -la dist/
108- test -f dist/harmont-${VERSION}.tar.gz
109- test -f dist/harmont-${VERSION}-py3-none-any.whl
110-
111- - name : Publish to PyPI via Trusted Publishing
112- uses : pypa/gh-action-pypi-publish@release/v1
113- with :
114- packages-dir : dsls/harmont-py/dist/
115-
116106 build-binary :
117107 name : Build ${{ matrix.target }}
118108 timeout-minutes : 30
0 commit comments