Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI for publishing to ⊇istributive's archive server #432

Merged
merged 6 commits into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions .github/workflows/test-and-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
tags:
- '*'
- 'v*'
workflow_call:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -54,6 +54,10 @@ defaults:
# run with Git Bash on Windows
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-spidermonkey-unix:
strategy:
Expand Down Expand Up @@ -297,7 +301,7 @@ jobs:
publish:
needs: [build-and-test, sdist]
runs-on: ubuntu-20.04
if: ${{ success() && github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
if: ${{ success() && github.event_name == 'push' && github.ref_type == 'tag' }}
steps:
# no need to checkout
- uses: actions/setup-python@v5
Expand All @@ -320,7 +324,7 @@ jobs:
# and deploy the static files to GitHub Pages
needs: [build-and-test, sdist]
runs-on: ubuntu-20.04
if: ${{ (success() || failure()) && github.ref_name == 'main' }} # publish nightly builds regardless of tests failure
if: ${{ (success() || failure()) && (github.ref_name == 'main' || github.ref_type == 'tag') }} # publish nightly builds regardless of tests failure
permissions: # grant GITHUB_TOKEN the permissions required to make a Pages deployment
pages: write
id-token: write
Expand Down Expand Up @@ -375,3 +379,45 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
publish-archive:
# Publish to ⊇istributive's archive server (https://archive.distributed.computer/releases/pythonmonkey/)
needs: [build-and-test, sdist]
runs-on: ubuntu-20.04
if: ${{ (success() || failure()) && (github.ref_name == 'main' || github.ref_type == 'tag') }}
environment:
name: archive
url: https://archive.distributed.computer/releases/pythonmonkey/${{ steps.get_path.outputs.ARCHIVE_PATH }}
steps:
# no need to checkout
- name: Download wheels built
uses: actions/download-artifact@v3
with:
name: wheel-${{ github.run_id }}-${{ github.sha }}
path: ./
- name: Download docs html generated by Doxygen
uses: actions/download-artifact@v3
with:
name: docs-${{ github.run_id }}-${{ github.sha }}
path: ./docs/
- name: Get the pythonmonkey/pminit version number
run: |
file=$(ls ./pminit*.tar.gz | head -1)
pm_version=$(basename "${file%.tar.gz}" | cut -d- -f2) # match /pminit-([^-]+).tar.gz/
echo "PM_VERSION=$pm_version" >> $GITHUB_ENV
- name: Get the archive type (nightly or releases) and path
id: get_path
run: |
path="$ARCHIVE_TYPE/$PM_VERSION/"
echo "$path"
echo "ARCHIVE_PATH=$path" >> $GITHUB_OUTPUT
env:
ARCHIVE_TYPE: ${{ (github.ref_type == 'tag' && 'releases') || 'nightly' }}
- name: SCP to the archive server
uses: appleboy/[email protected]
with:
host: ${{ secrets.ARCHIVE_HOST }}
username: pythonmonkey
key: ${{ secrets.ARCHIVE_KEY }}
source: ./*
target: archive/${{ steps.get_path.outputs.ARCHIVE_PATH }}
overwrite: true
Loading