|
25 | 25 | with:
|
26 | 26 | version: pre-release
|
27 | 27 |
|
| 28 | + - name: Install jq |
| 29 | + run: sudo apt-get install jq |
| 30 | + |
28 | 31 | - name: Restore cached _freeze folder
|
29 | 32 | id: cache-primes-restore
|
30 | 33 | uses: actions/cache/restore@v4
|
|
35 | 38 | restore-keys: |
|
36 | 39 | ${{ runner.os }}-primes
|
37 | 40 |
|
| 41 | + - name: Extract version from _quarto.yml |
| 42 | + id: extract_version |
| 43 | + run: | |
| 44 | + minor_version=$(grep -oP 'text:\s+"v\K\d+\.\d+' _quarto.yml) |
| 45 | + echo "minor_version=$minor_version" >> $GITHUB_ENV |
| 46 | +
|
| 47 | + - name: Fetch latest bugfix version for the extracted minor version |
| 48 | + id: fetch_latest_bugfix |
| 49 | + run: | |
| 50 | + repo_url="https://api.github.com/repos/TuringLang/Turing.jl/tags" |
| 51 | + tags=$(curl -s $repo_url | jq -r '.[].name') |
| 52 | + stable_tags=$(echo "$tags" | grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+$') |
| 53 | + latest_bugfix=$(echo "$stable_tags" | grep "^v${{ env.minor_version }}" | sort -rV | head -n 1) |
| 54 | + echo "version=$latest_bugfix" >> $GITHUB_ENV |
| 55 | +
|
| 56 | + - name: Fetch the actual latest bugfix version |
| 57 | + id: fetch_latest_bugfix_actual |
| 58 | + run: | |
| 59 | + latest=$(curl --silent "https://api.github.com/repos/TuringLang/Turing.jl/releases/latest" | jq -r .tag_name) |
| 60 | + echo "LATEST=$latest" >> $GITHUB_ENV |
| 61 | +
|
| 62 | + - name: Run Changelog and Versions Scripts |
| 63 | + if: env.version == env.LATEST |
| 64 | + run: | |
| 65 | + sh assets/scripts/changelog.sh |
| 66 | + sh assets/scripts/versions.sh |
| 67 | +
|
38 | 68 | - name: Render Quarto site
|
39 | 69 | run: quarto render
|
40 | 70 |
|
|
49 | 79 | _freeze/
|
50 | 80 | key: ${{ runner.os }}-primes-${{ github.run_id }}
|
51 | 81 |
|
52 |
| - - name: Install jq |
53 |
| - run: sudo apt-get install jq |
54 |
| - |
55 | 82 | - name: Fetch search_original.json from main site
|
56 | 83 | run: curl -O https://raw.githubusercontent.com/TuringLang/turinglang.github.io/gh-pages/search_original.json
|
57 | 84 |
|
|
65 | 92 | run: |
|
66 | 93 | jq -s '.[0] + .[1]' _site/search_original.json fixed_main_search.json > _site/search.json
|
67 | 94 |
|
68 |
| - - name: Extract version from _quarto.yml |
69 |
| - id: extract_version |
70 |
| - run: | |
71 |
| - minor_version=$(grep -oP 'text:\s+"v\K\d+\.\d+' _quarto.yml) |
72 |
| - echo "minor_version=$minor_version" >> $GITHUB_ENV |
73 |
| -
|
74 |
| - - name: Fetch latest bugfix version for the extracted minor version |
75 |
| - id: fetch_latest_bugfix |
76 |
| - run: | |
77 |
| - repo_url="https://api.github.com/repos/TuringLang/Turing.jl/tags" |
78 |
| - tags=$(curl -s $repo_url | jq -r '.[].name') |
79 |
| - stable_tags=$(echo "$tags" | grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+$') |
80 |
| - latest_bugfix=$(echo "$stable_tags" | grep "^v${{ env.minor_version }}" | sort -rV | head -n 1) |
81 |
| - echo "version=$latest_bugfix" >> $GITHUB_ENV |
82 |
| -
|
83 |
| - - name: Fetch the actual latest bugfix version |
84 |
| - id: fetch_latest_bugfix_actual |
85 |
| - run: | |
86 |
| - latest=$(curl --silent "https://api.github.com/repos/TuringLang/Turing.jl/releases/latest" | jq -r .tag_name) |
87 |
| - echo "LATEST=$latest" >> $GITHUB_ENV |
88 |
| -
|
89 | 95 | - name: Deploy versioned docs
|
90 | 96 | uses: JamesIves/github-pages-deploy-action@v4
|
91 | 97 | with:
|
|
0 commit comments