Skip to content

Commit

Permalink
CI: Fixing artifacts publication
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGr committed Dec 5, 2023
1 parent 27b3b7e commit e56d654
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/publish-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,26 @@ jobs:
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: learn-ocaml-www.zip
path: _site/artifacts/
path: artifacts/
- name: Get previous artifact learn-ocaml-linux-x86_64
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: learn-ocaml-linux-x86_64
path: _site/artifacts/
path: artifacts/
- name: Get previous artifact learn-ocaml-darwin-x86_64
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: learn-ocaml-darwin-x86_64
path: _site/artifacts/
- name: Generate HTML index
path: artifacts/
- name: Move into place and generate HTML index
run: |
cd _site/artifacts
tree -H . -L 1 --noreport --dirsfirst -T Learn-ocaml latest development artifacts' --charset utf-8 -o index.html
ls -hal _site
ls -hal artifacts
mv artifacts _site
cd _site/artifacts && \
tree -H . -L 1 --noreport --dirsfirst -T Learn-ocaml latest development artifacts' --charset utf-8 -o index.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v2

Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/static-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ jobs:
run: 'docker build -t learn-ocaml-compilation --target=compilation .'
- name: 'Build ${{ matrix.arch_dir }}.zip'
run: |
docker run -i --rm -w /home/opam/install-prefix/share/learn-ocaml -u 0 --entrypoint='' learn-ocaml-compilation sh -c \
'mv www "${{ matrix.arch_dir }}" >&2 && apk add --no-cache zip >&2 && zip -r "${{ matrix.arch_dir }}.zip" "${{ matrix.arch_dir }}" >&2 && tar c "${{ matrix.arch_dir }}.zip"' | \
tar vx
- name: 'Upload ${{ matrix.arch_dir }}.zip'
container=$(docker create learn-ocaml-compilation)
docker cp \
"$container:/home/opam/install-prefix/share/learn-ocaml/www" \
'${{ matrix.arch_dir }}'
docker rm "$container"
- name: 'Upload ${{ matrix.arch_dir }}'
uses: actions/upload-artifact@v2
with:
name: '${{ matrix.arch_dir }}.zip'
path: '${{ matrix.arch_dir }}.zip'
name: ${{ matrix.arch_dir }}
path: ${{ matrix.arch_dir }}/*
static-bin-linux:
name: Builds static Linux binaries
if: ${{ github.event_name != 'schedule' || github.repository == 'ocaml-sf/learn-ocaml' }}
Expand Down

0 comments on commit e56d654

Please sign in to comment.