Skip to content

Commit 0fa946f

Browse files
committed
CI: publish to ⊇istributive's archive server
URL: https://archive.distributed.computer/releases/pythonmonkey/
1 parent 4ee52da commit 0fa946f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/test-and-publish.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,3 +379,44 @@ jobs:
379379
- name: Deploy to GitHub Pages
380380
id: deployment
381381
uses: actions/deploy-pages@v2
382+
publish-archive:
383+
# Publish to ⊇istributive's archive server (https://archive.distributed.computer/releases/pythonmonkey/)
384+
needs: [build-and-test, sdist]
385+
runs-on: ubuntu-20.04
386+
if: ${{ (success() || failure()) && true }} # (github.ref_name == 'main' || github.ref_type == 'tag')
387+
environment:
388+
name: archive
389+
url: https://archive.distributed.computer/releases/pythonmonkey/${{ steps.get_path.outputs.ARCHIVE_PATH }}
390+
steps:
391+
# no need to checkout
392+
- name: Download wheels built
393+
uses: actions/download-artifact@v3
394+
with:
395+
name: wheel-${{ github.run_id }}-${{ github.sha }}
396+
path: ./
397+
- name: Download docs html generated by Doxygen
398+
uses: actions/download-artifact@v3
399+
with:
400+
name: docs-${{ github.run_id }}-${{ github.sha }}
401+
path: ./docs/
402+
- name: Get the pythonmonkey/pminit version number
403+
run: |
404+
file=$(ls ./pminit*.tar.gz | head -1)
405+
pm_version=$(basename "${file%.tar.gz}" | cut -d- -f2) # match /pminit-([^-]+).tar.gz/
406+
echo "PM_VERSION=$pm_version" >> $GITHUB_ENV
407+
- name: Get the archive type (nightly or releases) and path
408+
id: get_path
409+
run: |
410+
path="$ARCHIVE_TYPE/$PM_VERSION/"
411+
echo "$path"
412+
echo "ARCHIVE_PATH=$path" >> $GITHUB_OUTPUT
413+
env:
414+
ARCHIVE_TYPE: ${{ (github.ref_type == 'tag' && 'releases') || 'nightly' }}
415+
- name: SCP to the archive server
416+
uses: appleboy/[email protected]
417+
with:
418+
host: ${{ secrets.ARCHIVE_HOST }}
419+
username: ${{ secrets.ARCHIVE_USERNAME }}
420+
key: ${{ secrets.ARCHIVE_KEY }}
421+
source: ./*
422+
target: ${{ steps.get_path.outputs.ARCHIVE_PATH }}

0 commit comments

Comments
 (0)