Skip to content

Commit c3cdaec

Browse files
authored
Fixed publishing on Windows. (#150)
* 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.
1 parent 8fbd9d7 commit c3cdaec

2 files changed

Lines changed: 18 additions & 12 deletions

File tree

.github/workflows/bare.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# GitHub actions to build and test python-package.
2+
# GitHub actions for building and testing python-package on bare GitHub VMs.
33
#
44
# Don't use `-latest` for targeted VMs, pin specific OS versions instead.
55
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
@@ -38,8 +38,8 @@ jobs:
3838
if: startsWith(matrix.runs-on, 'ubuntu')
3939
run: sudo apt-get install -y libncurses5-dev
4040

41-
# GHA's checkout action seems to be misbehaving on ARM64 and consequently
42-
# our build script can't get current revision from cloned sources.
41+
# Git's version on our ARM64 runner is too old for actions/checkout to
42+
# create a local repo. Beware this fails on opening a new PR.
4343
- name: Clone sources independently
4444
run: |
4545
git init $CHEVAH_REPO
@@ -54,6 +54,7 @@ jobs:
5454
# Prepare the code.
5555
git clean -f
5656
git reset --hard ${{ github.event.after }}
57+
git log -1 --format='%H'
5758
5859
- name: Detect OS and build Python
5960
run: |
@@ -72,7 +73,6 @@ jobs:
7273
./chevah_build compat
7374
7475
# Upload using a (per-OS selected) sftp command, then show final links.
75-
# Remove key in same step to have it deleted even if publishing fails.
7676
- name: Upload testing package
7777
run: |
7878
mkdir -pv ~/.ssh/
@@ -81,7 +81,8 @@ jobs:
8181
chmod 600 priv_key
8282
echo "${{ secrets.SFTPPLUS_BIN_PRIV_KEY }}" > priv_key
8383
echo "${{ secrets.SFTPPLUS_BIN_HOST_KEY }}" > ~/.ssh/known_hosts
84-
./publish_dist.sh ; rm priv_key
84+
./publish_dist.sh
85+
rm priv_key
8586
8687
# If one of the above steps fails, fire up tmate for remote debugging.
8788
- name: Tmate debug on failure
@@ -150,7 +151,8 @@ jobs:
150151
chmod 600 priv_key
151152
echo "${{ secrets.SFTPPLUS_BIN_PRIV_KEY }}" > priv_key
152153
echo "${{ secrets.SFTPPLUS_BIN_HOST_KEY }}" > ~/.ssh/known_hosts
153-
./publish_dist.sh ; rm priv_key
154+
./publish_dist.sh
155+
rm priv_key
154156
155157
- name: Tmate debug on failure
156158
if: failure() && env.TMATE_DEBUG == 'yes'
@@ -214,7 +216,6 @@ jobs:
214216
# which is more finicky in regards to file permissions.
215217
# Beware the commands in this step run under PowerShell.
216218
- name: Prepare SFTP upload
217-
shell: powershell
218219
run: |
219220
mkdir -p ~/.ssh/
220221
cd python-package/
@@ -226,7 +227,11 @@ jobs:
226227
choco install --yes --no-progress openssh
227228
228229
- name: Upload testing package
229-
run: bash -c 'cd python-package; ./publish_dist.sh ; rm priv_key'
230+
shell: bash
231+
run: |
232+
cd python-package
233+
./publish_dist.sh
234+
rm priv_key
230235
231236
- name: Tmate debug on failure
232237
if: failure() && env.TMATE_DEBUG == 'yes'

.github/workflows/docker.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# GitHub actions for building and testing through containers.
2+
# GitHub actions for building and testing python-package through containers.
33
#
44
# For best support, use `-latest` for runners spinning up containers. More at
55
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners.
@@ -77,7 +77,7 @@ jobs:
7777
# be detrimental to our testing, e.g. CentOS 5's "requiretty" option.
7878
echo '%adm ALL=NOPASSWD: ALL' > /etc/sudoers
7979
80-
# GHA's checkout action doesn't work on CentOS 5.
80+
# GHA's checkout action doesn't work on CentOS 5. This fails on opening a new PR.
8181
- name: Clone sources independently
8282
run: |
8383
cd /home/chevah/
@@ -93,6 +93,7 @@ jobs:
9393
# Prepare the code.
9494
git clean -f
9595
git reset --hard ${{ github.event.after }}
96+
git log -1 --format='%H'
9697
9798
- name: Detect OS and build Python
9899
run: |
@@ -113,7 +114,6 @@ jobs:
113114
# su chevah -lc "umask 002; cd /home/chevah/python-package; ./chevah_build compat"
114115

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

0 commit comments

Comments
 (0)