Skip to content

Commit

Permalink
Fixed publishing on Windows. (#150)
Browse files Browse the repository at this point in the history
* Fixed publishing on Windows and its error reporting.

* Cosmetic changes.

* Check if actions/checkout ARM64 is fine when using 'with: ref'.

* Close brackets appropriately.

* No need to change dirs with actions/checkout.

* Back to cloning sources independently on Linux.

* Show current git HEAD after cloning sources.
  • Loading branch information
dumol authored Jul 23, 2021
1 parent 8fbd9d7 commit c3cdaec
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/bare.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# GitHub actions to build and test python-package.
# GitHub actions for building and testing python-package on bare GitHub VMs.
#
# Don't use `-latest` for targeted VMs, pin specific OS versions instead.
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
Expand Down Expand Up @@ -38,8 +38,8 @@ jobs:
if: startsWith(matrix.runs-on, 'ubuntu')
run: sudo apt-get install -y libncurses5-dev

# GHA's checkout action seems to be misbehaving on ARM64 and consequently
# our build script can't get current revision from cloned sources.
# Git's version on our ARM64 runner is too old for actions/checkout to
# create a local repo. Beware this fails on opening a new PR.
- name: Clone sources independently
run: |
git init $CHEVAH_REPO
Expand All @@ -54,6 +54,7 @@ jobs:
# Prepare the code.
git clean -f
git reset --hard ${{ github.event.after }}
git log -1 --format='%H'
- name: Detect OS and build Python
run: |
Expand All @@ -72,7 +73,6 @@ jobs:
./chevah_build compat
# Upload using a (per-OS selected) sftp command, then show final links.
# Remove key in same step to have it deleted even if publishing fails.
- name: Upload testing package
run: |
mkdir -pv ~/.ssh/
Expand All @@ -81,7 +81,8 @@ jobs:
chmod 600 priv_key
echo "${{ secrets.SFTPPLUS_BIN_PRIV_KEY }}" > priv_key
echo "${{ secrets.SFTPPLUS_BIN_HOST_KEY }}" > ~/.ssh/known_hosts
./publish_dist.sh ; rm priv_key
./publish_dist.sh
rm priv_key
# If one of the above steps fails, fire up tmate for remote debugging.
- name: Tmate debug on failure
Expand Down Expand Up @@ -150,7 +151,8 @@ jobs:
chmod 600 priv_key
echo "${{ secrets.SFTPPLUS_BIN_PRIV_KEY }}" > priv_key
echo "${{ secrets.SFTPPLUS_BIN_HOST_KEY }}" > ~/.ssh/known_hosts
./publish_dist.sh ; rm priv_key
./publish_dist.sh
rm priv_key
- name: Tmate debug on failure
if: failure() && env.TMATE_DEBUG == 'yes'
Expand Down Expand Up @@ -214,7 +216,6 @@ jobs:
# which is more finicky in regards to file permissions.
# Beware the commands in this step run under PowerShell.
- name: Prepare SFTP upload
shell: powershell
run: |
mkdir -p ~/.ssh/
cd python-package/
Expand All @@ -226,7 +227,11 @@ jobs:
choco install --yes --no-progress openssh
- name: Upload testing package
run: bash -c 'cd python-package; ./publish_dist.sh ; rm priv_key'
shell: bash
run: |
cd python-package
./publish_dist.sh
rm priv_key
- name: Tmate debug on failure
if: failure() && env.TMATE_DEBUG == 'yes'
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# GitHub actions for building and testing through containers.
# GitHub actions for building and testing python-package through containers.
#
# For best support, use `-latest` for runners spinning up containers. More at
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners.
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
# be detrimental to our testing, e.g. CentOS 5's "requiretty" option.
echo '%adm ALL=NOPASSWD: ALL' > /etc/sudoers
# GHA's checkout action doesn't work on CentOS 5.
# GHA's checkout action doesn't work on CentOS 5. This fails on opening a new PR.
- name: Clone sources independently
run: |
cd /home/chevah/
Expand All @@ -93,6 +93,7 @@ jobs:
# Prepare the code.
git clean -f
git reset --hard ${{ github.event.after }}
git log -1 --format='%H'
- name: Detect OS and build Python
run: |
Expand All @@ -113,7 +114,6 @@ jobs:
# su chevah -lc "umask 002; cd /home/chevah/python-package; ./chevah_build compat"

# Using `~/` is problematic under Docker, use `/root/`.
# Remove key in same step to avoid leaving it on disk if publishing fails.
- name: Upload testing package
run: |
mkdir -pv /root/.ssh/
Expand All @@ -122,4 +122,5 @@ jobs:
chmod 600 priv_key
echo "${{ secrets.SFTPPLUS_BIN_PRIV_KEY }}" > priv_key
echo "${{ secrets.SFTPPLUS_BIN_HOST_KEY }}" > /root/.ssh/known_hosts
./publish_dist.sh ; rm priv_key
./publish_dist.sh
rm priv_key

0 comments on commit c3cdaec

Please sign in to comment.