From 3ebcf80026aa9dee8ea9e6f943106144738e1c43 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Tue, 28 Apr 2020 11:26:43 -0400 Subject: [PATCH] Improve CI snapshot creation, and build packages and Racket CS. --- .github/workflows/ci-push.yml | 41 +++++++++++++------------------- .github/workflows/site-small.rkt | 37 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/site-small.rkt diff --git a/.github/workflows/ci-push.yml b/.github/workflows/ci-push.yml index 5d26d6a2f4..26a0721818 100644 --- a/.github/workflows/ci-push.yml +++ b/.github/workflows/ci-push.yml @@ -619,14 +619,15 @@ jobs: with: name: scanbuild-cs-${{ github.sha }} path: racketcs-report-${{ github.sha }}.tar.bz2 - - create-installer3m: + + create-installer3m: runs-on: ubuntu-18.04 - + steps: - uses: actions/checkout@v1 - with: - fetch-depth: 10 + - run: | + git checkout -b github_actions_build_branch___ # have to be on a branch + - name: Install pkg dependencies run: | sudo apt update @@ -637,32 +638,22 @@ jobs: distribution: 'full' variant: 'regular' version: 'current' - - - name: Create site.rkt + + - name: Install s3-sync run: | - which racket - echo "#lang distro-build/config" > ${{ runner.temp }}/site.rkt - echo "(machine #:racket \"/usr/bin/racket\" #:versionless? #true #:pkgs (list))" >> ${{ runner.temp }}/site.rkt - cat ${{ runner.temp }}/site.rkt + sudo raco pkg install -i --auto s3-sync + - name: Building + env: + DISTRO_BUILD_SITE_DEST: "${{ runner.temp }}/site-dest/" run: | export cpus=$(grep -c ^processor /proc/cpuinfo) - make installers RACKET=/usr/bin/racket CONFIG="${{ runner.temp }}/site.rkt" -j $((cpus+1)) - mv bundle/ ${{ github.sha }}/ - - uses: actions/upload-artifact@v1 - if: always() - with: - name: racket3m-installer-${{ github.sha }} - path: ${{ github.sha }}/racket-x86_64-linux.sh - + make snapshot-site PLAIN_RACKET=/usr/bin/racket CONFIG=".github/workflows/site-small.rkt" -j $((cpus+1)) - name: S3 Sync - uses: jakejarvis/s3-sync-action@v0.5.1 - with: - args: --acl public-read --exclude '*' --include '${{ github.sha }}/racket-x86_64-linux.sh' env: - AWS_S3_BUCKET: snapshot.racket-lang.org AWS_ACCESS_KEY_ID: ${{ secrets.AWSAccessKeyID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWSSecretKey }} - DEST_DIR: 'ci-snapshots/' - + run: | + ls -l ${{ runner.temp }}/site-dest/ci-snapshots/ + raco s3-sync --acl public-read --web --redirect-links ${{ runner.temp }}/site-dest/ci-snapshots/ s3://snapshot.racket-lang.org/ci-snapshots/ diff --git a/.github/workflows/site-small.rkt b/.github/workflows/site-small.rkt new file mode 100644 index 0000000000..ad17a1d362 --- /dev/null +++ b/.github/workflows/site-small.rkt @@ -0,0 +1,37 @@ +#lang distro-build/config +(require racket/format) + +(define (build-dir-name) + (case (current-mode) + [("release") "release-build"] + [else "build"])) +(define (dest-dir-name) + (case (current-mode) + [("release") "ci-release"] + [else (~a "ci-snapshots/" (current-stamp))])) + +(define server-base-url (~a "https://snapshots.racket-lang.org/" (dest-dir-name) "/")) + +(define distro-content + '("main-distribution")) + +(define (prebuilt-racket) + (or (and (getenv "PLTHOME") (~a (getenv "PLTHOME") "/racket/" "bin/" "racket")) + "/usr/bin/racket")) + +;; The overall configuration: +(parallel + #:pkgs distro-content + #:dist-base-url server-base-url + #:site-dest (build-path (getenv "DISTRO_BUILD_SITE_DEST") (dest-dir-name)) + #:plt-web-style? #t + #:site-title (format "Snapshot: ~a" (current-stamp)) + (machine #:name "Racket BC (Ubuntu 18.04, x86_64)" + #:racket (prebuilt-racket) + #:versionless? #true) + (machine #:name "Racket CS (Ubuntu 18.04, x86_64)" + ;; can't use the pre-built Racket with Racket CS + #:versionless? #true + #:dir "cs_build" + #:variant 'cs + #:dist-suffix "cs"))