Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed git-flow to github-flow. #53

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Release

on:
push:
tags:
- '*'
release:
types:
- released

permissions:
contents: write
Expand All @@ -25,6 +25,9 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Bumping version
run: |
python ./scripts/version_bumper.py --target Cargo.toml "${{ github.ref_name }}"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand Down Expand Up @@ -69,6 +72,9 @@ jobs:
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
- name: Bumping version
run: |
python ./scripts/version_bumper.py --target Cargo.toml "${{ github.ref_name }}"
- name: Install OpenSSL
run: vcpkg install openssl:x64-windows-static-md
- name: Build wheels
Expand Down Expand Up @@ -100,6 +106,9 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Bumping version
run: |
python ./scripts/version_bumper.py --target Cargo.toml "${{ github.ref_name }}"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -123,6 +132,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Bumping version
run: |
python ./scripts/version_bumper.py --target Cargo.toml "${{ github.ref_name }}"
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
Expand Down Expand Up @@ -154,6 +169,9 @@ jobs:
with:
python-version: '3.11'
architecture: x64
- name: Bumping version
run: |
python ./scripts/version_bumper.py --target Cargo.toml "${{ github.ref_name }}"
- name: Instal OpenSSL
run: sudo apt-get update && sudo apt-get install libssl-dev openssl
- name: Build wheels
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 = "scyllapy"
version = "1.3.1"
version = "0.0.0"
edition = "2021"

[lib]
Expand Down
38 changes: 38 additions & 0 deletions scripts/version_bumper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import re
import argparse
from pathlib import Path


def parse_args() -> argparse.Namespace:
"""Parse command line arguments."""
parser = argparse.ArgumentParser()
parser.add_argument(
"--target",
"-t",
dest="target",
type=Path,
default="Cargo.toml",
)
parser.add_argument("version", type=str)
return parser.parse_args()


def main() -> None:
"""Main function."""
args = parse_args()
with args.target.open("r") as f:
contents = f.read()

contents = re.sub(
r"version\s*=\s*\"(.*)\"",
f'version = "{args.version}"',
contents,
count=1,
)

with args.target.open("w") as f:
f.write(contents)


if __name__ == "__main__":
main()
Loading