Skip to content

Commit

Permalink
Test package version from Git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
simu committed Jan 10, 2024
1 parent 77f3833 commit 11083a4
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,22 @@ permissions:
contents: read

jobs:
set-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.genversion.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Generate package version from Git tag
id: genversion
run: |
echo "version=$(git describe --tags --always --match=v* | sed 's/^v//' | cut -d- -f1,2)" >> "$GITHUB_OUTPUT"
linux:
runs-on: ubuntu-latest
needs: set-version
strategy:
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
Expand All @@ -29,6 +43,14 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-edit
- name: Set package version
env:
VERSION: ${{ needs.set-version.outputs.version }}
run: |
cargo set-version "${VERSION}"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand Down Expand Up @@ -67,6 +89,7 @@ jobs:
windows:
runs-on: windows-latest
needs: set-version
strategy:
matrix:
target: [x64, x86]
Expand All @@ -76,6 +99,14 @@ jobs:
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
- uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-edit
- name: Set package version
env:
VERSION: ${{ needs.set-version.outputs.version }}
run: |
cargo set-version "${VERSION}"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -98,6 +129,7 @@ jobs:
macos:
runs-on: macos-latest
needs: set-version
strategy:
matrix:
target: [x86_64, aarch64]
Expand All @@ -106,6 +138,14 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-edit
- name: Set package version
env:
VERSION: ${{ needs.set-version.outputs.version }}
run: |
cargo set-version "${VERSION}"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -128,8 +168,17 @@ jobs:
sdist:
runs-on: ubuntu-latest
needs: set-version
steps:
- uses: actions/checkout@v4
- uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-edit
- name: Set package version
env:
VERSION: ${{ needs.set-version.outputs.version }}
run: |
cargo set-version "${VERSION}"
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "reclass-rs"
version = "0.1.1"
version = "0.0.0"
edition = "2021"
license = "BSD-3-Clause"
authors = ["VSHN AG <[email protected]>"]
Expand Down

0 comments on commit 11083a4

Please sign in to comment.