diff --git a/.github/workflows/dev-release.yaml b/.github/workflows/dev-release.yaml new file mode 100644 index 00000000..08998350 --- /dev/null +++ b/.github/workflows/dev-release.yaml @@ -0,0 +1,67 @@ +name: Zowe SDK Release + +on: + pull_request_target: + types: + - closed + branches: + - main + +jobs: + release: + if: ${{ github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release-dev') }} + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + ref: main + token: ${{ secrets.ZOWE_ROBOT_TOKEN }} + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Increment dev version + id: update-version + shell: python + run: | + import sys + sys.path.append("src") + from _version import __version__ + prerelease_tag = "dev" + tag_end_index = __version__.index(prerelease_tag) + len(prerelease_tag) + new_version = __version__[:tag_end_index] + str(int(__version__[tag_end_index:]) + 1) + with open("src/_version.py", 'w') as f: + f.write("__version__ = \"" + new_version + "\"\n") + print("::set-output name=version::" + new_version) + print("::set-output name=cargo-version::" + "-".join(new_version.rsplit(".", 1))) + + - name: Increment dev version (cargo) + run: cargo install cargo-edit && cargo set-version ${{ steps.update-version.outputs.cargo-version }} + working-directory: src/secrets + + - name: Build dist wheels + run: bash build.sh + + - name: Commit version update + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: main + commit_message: "Bump version to ${{ steps.update-version.outputs.version }} [ci skip]" + commit_options: "--signoff" + commit_user_name: ${{ secrets.ZOWE_ROBOT_USER }} + commit_user_email: ${{ secrets.ZOWE_ROBOT_EMAIL }} + file_pattern: "src/_version.py src/secrets/Cargo.*" + tagging_message: v${{ steps.update-version.outputs.version }} + + - name: Publish packages to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_ROBOT_TOKEN }} diff --git a/.github/workflows/dev-release.yaml.old b/.github/workflows/dev-release.yaml.old deleted file mode 100644 index 512f5846..00000000 --- a/.github/workflows/dev-release.yaml.old +++ /dev/null @@ -1,69 +0,0 @@ -name: Zowe SDK Release - -on: - pull_request_target: - types: - - closed - branches: - - main - -jobs: - release: - if: ${{ github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release-dev') }} - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - ref: main - token: ${{ secrets.ZOWE_ROBOT_TOKEN }} - - - name: Set up Python 3.7 - uses: actions/setup-python@v4 - with: - python-version: 3.7 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - - name: Increment dev version - id: update-version - shell: python - run: | - import sys - sys.path.append("src") - from _version import __version__ - prerelease_tag = "dev" - tag_end_index = __version__.index(prerelease_tag) + len(prerelease_tag) - new_version = __version__[:tag_end_index] + str(int(__version__[tag_end_index:]) + 1) - with open("src/_version.py", 'w', encoding="utf-8") as f: - f.write("__version__ = \"" + new_version + "\"\n") - print("::set-output name=version::" + new_version) - - - name: Build dist wheels - run: bash build.sh - - - name: Create zip bundle - working-directory: dist - run: | - pip download -f . --no-binary=pyyaml zowe-${{ steps.update-version.outputs.version }}-py3-none-any.whl - zip zowe-python-sdk-${{ steps.update-version.outputs.version }}.zip PyYAML*.tar.gz *.whl - - - name: Commit version update - uses: stefanzweifel/git-auto-commit-action@v4 - with: - branch: main - commit_message: 'Bump version to ${{ steps.update-version.outputs.version }} [ci skip]' - commit_options: '--signoff' - commit_user_name: ${{ secrets.ZOWE_ROBOT_USER }} - commit_user_email: ${{ secrets.ZOWE_ROBOT_EMAIL }} - file_pattern: 'src/_version.py' - tagging_message: v${{ steps.update-version.outputs.version }} - - - name: Create GitHub release - uses: softprops/action-gh-release@v1 - with: - files: 'dist/zowe-python-sdk-${{ steps.update-version.outputs.version }}.zip' - tag_name: v${{ steps.update-version.outputs.version }} diff --git a/.github/workflows/secrets-sdk.yml b/.github/workflows/secrets-sdk.yml index 0e5900e7..8db3c6ac 100644 --- a/.github/workflows/secrets-sdk.yml +++ b/.github/workflows/secrets-sdk.yml @@ -125,20 +125,20 @@ jobs: name: wheels path: src/secrets/dist - # release: - # name: Release - # runs-on: ubuntu-latest - # if: ${{ startsWith(github.ref, 'refs/tags/') }} - # needs: [linux, windows, macos, sdist] - # steps: - # - uses: actions/download-artifact@v3 - # with: - # name: wheels - # - name: Publish to PyPI - # uses: PyO3/maturin-action@v1 - # env: - # MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} - # with: - # command: upload - # args: --non-interactive --skip-existing * - # working-directory: src/secrets + release: + name: Release + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/') }} + needs: [linux, windows, macos, sdist] + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + - name: Publish to PyPI + uses: PyO3/maturin-action@v1 + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_ROBOT_TOKEN }} + with: + command: upload + args: --non-interactive --skip-existing * + working-directory: src/secrets diff --git a/src/core/setup.py b/src/core/setup.py index 2711489d..5919f70f 100644 --- a/src/core/setup.py +++ b/src/core/setup.py @@ -28,7 +28,7 @@ "urllib3", ], extras_require={ - "secrets": [resolve_sdk_dep("secrets", "~=0.1.0")] + "secrets": [resolve_sdk_dep("secrets", "~=" + __version__)] }, packages=find_namespace_packages(include=["zowe.*"]), ) diff --git a/src/secrets/Cargo.lock b/src/secrets/Cargo.lock index 2f97c8e9..04130c4b 100644 --- a/src/secrets/Cargo.lock +++ b/src/secrets/Cargo.lock @@ -241,7 +241,7 @@ checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" [[package]] name = "keyring" -version = "0.1.0" +version = "1.0.0-dev10" dependencies = [ "pyo3", "secrets_core", diff --git a/src/secrets/Cargo.toml b/src/secrets/Cargo.toml index 068d339f..1552d198 100644 --- a/src/secrets/Cargo.toml +++ b/src/secrets/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "keyring" -version = "0.1.0" +version = "1.0.0-dev10" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html