-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run detect_os from pythia if BUILD_ENV_VARS file is missing. Drive-by changes : - Group the uploading logic in a separate script. - Show links for testing packages after uploading. - Simplify local `dist/` hierarchy to match uploads. - Minor cleanups.
- Loading branch information
Showing
9 changed files
with
108 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ jobs: | |
windows: | ||
# The type of runner that the job will run on | ||
runs-on: ${{ matrix.runs-on }} | ||
if: github.event_name == 'push' && contains(toJson(github.event.commits), '[skip ci]') == false | ||
strategy: | ||
# Workflow won't be cancelled at the first failed job. | ||
fail-fast: false | ||
|
@@ -40,9 +39,6 @@ jobs: | |
fetch-depth: 2 | ||
|
||
# Explicitly run our scripts with Bash, not PowerShell (GitHub's default). | ||
- name: Detect current OS | ||
run: bash ./brink.sh detect_os | ||
|
||
- name: Build Python | ||
run: bash ./pythia build | ||
|
||
|
@@ -62,11 +58,9 @@ jobs: | |
echo "${{ secrets.SFTPPLUS_BIN_HOST_KEY }}" > ~/.ssh/known_hosts | ||
choco install --yes --no-progress openssh | ||
# The publish_dist_sftp_batch file is generated by the build process. | ||
# Uploads using a (per-OS selected) sftp command, then shows final links. | ||
- name: Upload testing package | ||
run: | | ||
C:\Progra~1\OpenSSH-Win64\sftp.exe -b publish_dist_sftp_batch -i priv_key -o StrictHostKeyChecking=yes [email protected] | ||
echo "Package uploaded to https://bin.chevah.com:20443/testing/" | ||
run: bash ./publish_dist.sh | ||
|
||
# Per https://github.com/nelsonjchen/reverse-rdp-windows-github-actions, | ||
# but using the Ngrok token as password for the runnneradmin user. | ||
|
@@ -86,7 +80,6 @@ jobs: | |
linux: | ||
runs-on: ${{ matrix.runs-on }} | ||
if: github.event_name == 'push' && contains(toJson(github.event.commits), '[skip ci]') == false | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -101,9 +94,6 @@ jobs: | |
- name: Install required packages | ||
run: sudo apt-get install libncurses5-dev | ||
|
||
- name: Detect current OS | ||
run: bash ./brink.sh detect_os | ||
|
||
- name: Build Python | ||
run: bash ./pythia build | ||
|
||
|
@@ -117,8 +107,7 @@ jobs: | |
chmod 600 priv_key | ||
echo "${{ secrets.SFTPPLUS_BIN_PRIV_KEY }}" > priv_key | ||
echo "${{ secrets.SFTPPLUS_BIN_HOST_KEY }}" > ~/.ssh/known_hosts | ||
sftp -b publish_dist_sftp_batch -i priv_key -o StrictHostKeyChecking=yes [email protected] | ||
echo "Package uploaded to https://bin.chevah.com:20443/testing/" | ||
bash ./publish_dist.sh | ||
# If one of the above steps fails, fire up tmate for remote debugging. | ||
- name: Tmate debug on failure | ||
|
@@ -128,17 +117,13 @@ jobs: | |
|
||
macos: | ||
runs-on: macos-10.15 | ||
if: github.event_name == 'push' && contains(toJson(github.event.commits), '[skip ci]') == false | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: chevah/auto-cancel-redundant-job@v1 | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Detect current OS | ||
run: ./brink.sh detect_os | ||
|
||
# Some Homebrew libs pollute the build. | ||
# Also make sure binaries depending on these libs are out of the way. | ||
- name: Hack Homebrew | ||
|
@@ -160,8 +145,7 @@ jobs: | |
chmod 600 priv_key | ||
echo "${{ secrets.SFTPPLUS_BIN_PRIV_KEY }}" > priv_key | ||
echo "${{ secrets.SFTPPLUS_BIN_HOST_KEY }}" > ~/.ssh/known_hosts | ||
sftp -b publish_dist_sftp_batch -i priv_key -o StrictHostKeyChecking=yes [email protected] | ||
echo "Package uploaded to https://bin.chevah.com:20443/testing/" | ||
bash ./publish_dist.sh | ||
# Fix back Homebrew, to make everything functional for tmate debugging. | ||
- name: Unhack Homebrew | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
BASE_REQUIREMENTS='pip==20.2.4 chevah-brink==0.78.1 paver==1.2.4' | ||
PYTHON_CONFIGURATION='[email protected].b1fa3c6' | ||
PYTHON_CONFIGURATION='[email protected].e939358' | ||
# For production packages there are 2 options: | ||
BINARY_DIST_URI='https://github.com/chevah/pythia/releases/download' | ||
BINARY_DIST_URI='https://bin.chevah.com:20443/production' | ||
#BINARY_DIST_URI='https://bin.chevah.com:20443/production' | ||
# For testing packages, make sure this one is the last uncommented instance: | ||
#BINARY_DIST_URI='https://bin.chevah.com:20443/testing' | ||
PIP_INDEX='https://pypi.chevah.com/simple' | ||
|
||
# There are 2 build directories used in this repo: | ||
# * 'build' is a sub-dir used for building libffi, OpenSSL, Python, etc. | ||
# * $CHEVAH_BUILD_DIR is used by the Python that builds the above. | ||
# * $BUILD_DIR (set as 'build') is used for building this Python package. | ||
# * $CHEVAH_BUILD_DIR is used for Buildbot's Python when building through it. | ||
CHEVAH_BUILD_DIR='build-pythia' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Uploads dist packages to testing/ on Chevah's server, then shows final links. | ||
# To be used through GitHub actions. | ||
|
||
set -o nounset | ||
set -o errexit | ||
set -o pipefail | ||
|
||
dest_server="bin.chevah.com" | ||
dest_user="github-upload" | ||
root_link="https://${dest_server}:20443/testing" | ||
|
||
# The build/publish_dist_sftp_batch file is generated by the build process. | ||
# The private key comes from GitHub Secrets through the configured workflow. | ||
sftp_opts="\ | ||
-b build/publish_dist_sftp_batch -i priv_key -o StrictHostKeyChecking=yes" | ||
|
||
# Get $OS var and set sftp command accordingly. | ||
source BUILD_ENV_VARS | ||
case $OS in | ||
win) | ||
# To use an RSA key, upstream SFTP is installed through GitHub actions. | ||
sftp_cmd="/c/Progra~1/OpenSSH-Win64/sftp.exe" | ||
;; | ||
*) | ||
sftp_cmd="sftp" | ||
;; | ||
esac | ||
|
||
$sftp_cmd $sftp_opts ${dest_user}@${dest_server} | ||
|
||
# Get $DIST_DIR. | ||
source pythia.conf | ||
|
||
# As dist/ is rebuilt on every build, it should only have 1 sub-dir with 1 pkg. | ||
upload_dir=$(cd $DIST_DIR && ls -1) | ||
pkg_name=$(cd $DIST_DIR/$upload_dir && ls -1) | ||
|
||
# Local hierarchy matches the remote one. | ||
echo "Package $pkg_name uploaded to: ${root_link}/${upload_dir}/" | ||
echo "Direct link: ${root_link}/${upload_dir}/${pkg_name}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.