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

Update SDK release workflow to use Octorelease #224

Merged
merged 1 commit into from
Nov 14, 2023
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
67 changes: 0 additions & 67 deletions .github/workflows/dev-release.yaml

This file was deleted.

71 changes: 71 additions & 0 deletions .github/workflows/sdk-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Zowe SDK Release

on:
workflow_dispatch:
inputs:
version:
description: Update project version before publish
required: false
type: string
dry-run:
description: Dry run mode
required: false
type: boolean

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- 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: Update version
id: update-version
shell: python
run: |
import sys
sys.path.append("src")
from _version import __version__
new_version = "${{ inputs.version }}"
if new_version:
with open("src/_version.py", 'w') as f:
f.write("__version__ = \"" + new_version + "\"\n")
else:
new_version = __version__
print("::set-output name=version::" + new_version)
print("::set-output name=cargo-version::" + ("-".join(new_version.rsplit(".", 1)) if new_version.count(".") > 2 else new_version))

- name: Update 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: Archive artifacts
uses: actions/upload-artifact@v3
with:
path: dist/

- uses: zowe-actions/octorelease@feat/add-pypi-plugin
env:
GIT_COMMITTER_NAME: ${{ secrets.ZOWE_ROBOT_USER }}
GIT_COMMITTER_EMAIL: ${{ secrets.ZOWE_ROBOT_EMAIL }}
GIT_CREDENTIALS: x-access-token:${{ secrets.ZOWE_ROBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TWINE_USERNAME: _token_
TWINE_PASSWORD: ${{ secrets.PYPI_ROBOT_TOKEN }}
with:
dry-run: ${{ inputs.dry-run }}
new-version: ${{ steps.update-version.outputs.version }}
22 changes: 22 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
branches: [
{
name: "main",
level: "minor"
},
{
name: "zowe-v?-lts",
level: "patch"
}
// {
// name: "next",
// prerelease: true
// }
],
plugins: [
"@octorelease/changelog",
"@octorelease/pypi",
"@octorelease/github",
"@octorelease/git"
]
};