You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The steps below outline how to build mssql-cli locally on your dev environment.
43
-
### Build Instructions
44
-
1. To build a wheel package for the current platform, run:
45
-
```
46
-
python build.py build
47
-
```
48
-
49
-
### Installation Instructions
50
-
2. The prior build step created a wheel package, located in the `./dist/` folder. To test the installation of this wheel package, execute the following from `<clone_root>`, replacing values for `<version>` and `<timestamp>`:
The steps below outline how to build official builds and publish to PYPI.
75
-
76
-
### <a name="BumpVersion"></a>Bump Version
43
+
# Creating a New Version
77
44
The versioning format for `mssql-cli` uses the following naming scheme:
78
45
79
46
Versioning schema: {major}.{minor}.{patch}
@@ -83,60 +50,103 @@ To bump a particular segment of the version, from `<clone_root>` execute:
83
50
> bumpversion major -> <b>2</b>.0
84
51
> bumpversion minor -> 1.<b>1</b>
85
52
> bumpversion patch -> 1.0.<b>1</b>
86
-
87
53
</pre>
88
54
Check-in changes after running `bumpversion` and **validating the build output following a version bump**.
89
55
90
56
**Note**: bumpversion does not allow version bumping if your workspace has pending changes. This is to protect against any manual updates that may have been made which can lead to inconsistent versions across files. If you know what you are doing you can override this by appending `--allow-dirty` to the bumpversion command.
91
57
92
-
### Publish Build
93
-
**Important: ensure that the build is uploaded from macOS.**
94
58
95
-
1. Add a .pypirc configuration file:
59
+
# Generating Release Files
60
+
The steps below outline how to create wheel and source distribution files to publish to Azure Storage, and eventually PyPI for official release.
96
61
97
-
- Create a .pypirc file in your user directory:
98
-
#### Windows:
99
-
Example: C:\Users\bob\.pypirc
100
-
#### MacOS/Linux:
101
-
Example: /Users/bob/.pypirc
102
-
103
-
- Add the following content to the .pypirc file, replace `your_username` and `your_passsword` with your account information created from step 1:
104
-
```
105
-
[distutils]
106
-
index-servers=
107
-
pypi
108
-
109
-
[pypi]
110
-
username = sqlcli
111
-
password = <Get Password from Azure Key Vault> (https://sqltoolssecretstore.vault.azure.net/secrets/PYPI-AccountName-sqlcli/)
112
-
113
-
```
114
-
2. Set env var to indicate a official build:
115
-
#### Windows
116
-
```
117
-
set MSSQL_CLI_OFFICIAL_BUILD=True
118
-
```
62
+
## Daily Release Configuration
63
+
Release files are generated for daily release by default, as long as the `MSSQL_CLI_OFFICIAL_BUILD` environment variable is **not** set to `True`.
64
+
65
+
## Official Release Configuration
66
+
The `MSSQL_CLI_OFFICIAL_BUILD` enviornment variable must be set to `True` before build files are created. Although this step can be completed locally, we recommend running production pipelines in Azure DevOps with the enviornment variable set for each run.
67
+
68
+
If configured locally, instructions per OS are as follows:
To build a release package with wheel and source distribution files for the current platform, run:
74
+
```
75
+
python build.py build
76
+
```
77
+
Distribution files will be generated in `./dist/`. These files are eventually published to Azure Storage and PyPI for distribution.
78
+
79
+
**Note:** source distribution files will only get created on macOS. This platform was arbitrarily chosen to prevent redundant copies of source distributions when `build` is run on each platform in Azure DevOps.
80
+
81
+
# Publishing Release Files
82
+
The following instructions outline how to publish release files once generated n the `./dist/` folder.
83
+
84
+
## Publishing Daily Builds to Azure Storage
85
+
Publish build to daily storage account by calling:
86
+
```
87
+
python release.py publish_daily
88
+
```
119
89
120
-
#### MacOS/Linux
121
-
```
122
-
export MSSQL_CLI_OFFICIAL_BUILD=True
123
-
```
124
-
3. Build for the current platform:
125
-
```
126
-
python build.py build
127
-
```
90
+
## Publishing Official Builds
91
+
The steps below outline how to build official builds and publish to PyPI.
128
92
129
-
4. Publish to daily storage account:
130
-
```
131
-
python release.py publish_daily
132
-
```
93
+
### Configuration with PyPI
94
+
A `.pypirc` configuration file must be created in order to publish to PyPI. Place in the following user directories.
95
+
96
+
Examples for each OS:
97
+
* Windows: `C:\Users\bob\.pypirc`
98
+
* MacOS/Linux: `/Users/bob/.pypirc`
99
+
100
+
Add the below contents to the `.pypirc` file. **Note**: consult the mssql-cli OneNote for obtaining access to Azure Key Vault credentials, needed below.
101
+
102
+
```
103
+
[distutils]
104
+
index-servers=
105
+
pypi
106
+
testpypi
107
+
108
+
[pypi]
109
+
username: sqlcli
110
+
password: <GetPasswordfromAzureKeyVault>
111
+
112
+
[testpypi]
113
+
repository: https://test.pypi.org/legacy/
114
+
username: sqlcli
115
+
password: <GetPasswordfromAzureKeyVault>
116
+
```
117
+
118
+
### Test Publishing with TestPyPI
119
+
120
+
[TestPyPi](test.pypi.org) can be used to test distribution before going to production. To test publishing to TestPyPI, use the above `.pypirc` file and call:
121
+
```
122
+
twine upload --repository testpypi dist/*
123
+
```
124
+
125
+
[Click here](https://packaging.python.org/guides/using-testpypi/) to view TestPyPI docs.
126
+
127
+
### Publishing Official Release Files to PyPI
128
+
**Important: ensure that the build is uploaded from macOS.**
129
+
130
+
Follow the instructions below to publish a new release to PyPI after official release build files have been published to Azure Storage:
133
131
134
-
5. Download official wheels from storage account:
132
+
1. Download official wheels from storage account:
135
133
```
136
134
python release.py download_official_wheels
137
135
```
138
136
139
-
6. Publish downloaded wheels to PYPI:
137
+
2. Publish downloaded wheels to PyPI:
140
138
```
141
139
python release.py publish_official
142
140
```
141
+
142
+
# Installing Specific Release Files from Azure Storage
143
+
To test the installation a wheel or source distribution, execute the following from `<clone_root>`, replacing values for `<version>` and `<timestamp>`:
0 commit comments