-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed preview workflow and added current version in navbar! (#488)
* update preview workflow * testing preview workflow * testing preview workflow * testing preview workflow * testing preview workflow * tests * test2 * test2 * test2 * test2 * thollander comment workflow * thollander comment workflow * thollander comment workflow * thollander comment workflow * vcheck workflow test for forks * vcheck skip * added vdropdown with current version in navbar * hotfix in _quarto.yml * ajusted vdropdown a bit * updated comments * removed version and changelog from sidebar * testing new workflow * updated vcheck * updated version in _quarto.yml * updated version in _quarto.yml * Changed sed to awk * updated vcheck * updated publish.yml * . * . * updated vcheck * updated vcheck * another suggestion workflow * updated suggestion workflow * manual approach * json parsing fixed * continue on error previous worklow * finally its done😊 * Update .github/workflows/vcheck.yml Co-authored-by: Hong Ge <[email protected]> --------- Co-authored-by: Hong Ge <[email protected]>
- Loading branch information
1 parent
7a8fc92
commit b4d5b5b
Showing
6 changed files
with
87 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,43 @@ | ||
name: Check Turing.jl Version | ||
on: | ||
pull_request: | ||
paths: ['VERSION'] | ||
paths: ['_quarto.yml'] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
check-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get current version | ||
id: current_version | ||
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_OUTPUT | ||
- name: Extract current minor version | ||
id: extract_minor_version | ||
run: | | ||
minor_version=$(grep -oP 'text:\s+"v\K\d+\.\d+' _quarto.yml) | ||
echo "MINOR_VERSION=$minor_version" >> $GITHUB_OUTPUT | ||
- name: Get latest Turing.jl version | ||
id: latest_version | ||
- name: Fetch latest minor version | ||
id: fetch_latest_minor | ||
run: | | ||
latest=$(curl --silent "https://api.github.com/repos/TuringLang/Turing.jl/releases/latest" | jq -r .tag_name) | ||
repo_url="https://api.github.com/repos/TuringLang/Turing.jl/releases/latest" | ||
latest=$(curl -s $repo_url | jq -r .tag_name) | ||
actual_latest_minor=${latest%.*} | ||
echo "LATEST_MINOR=$actual_latest_minor" >> $GITHUB_OUTPUT | ||
echo "LATEST=$latest" >> $GITHUB_OUTPUT | ||
- name: Update VERSION file if outdated | ||
- name: Update _quarto.yml if outdated | ||
run: | | ||
if [ "${{ steps.current_version.outputs.VERSION }}" != "${{ steps.latest_version.outputs.LATEST }}" ]; then | ||
echo "${{ steps.latest_version.outputs.LATEST }}" > VERSION | ||
minor_version=${{ steps.extract_minor_version.outputs.MINOR_VERSION }} | ||
latest_minor=${{ steps.fetch_latest_minor.outputs.LATEST_MINOR }} | ||
if [ "$minor_version" != "$latest_minor" ]; then | ||
awk -v old="v$minor_version" -v new="$latest_minor" '{gsub(old, new); print}' _quarto.yml > temp.yml && mv temp.yml _quarto.yml | ||
echo "Updated _quarto.yml to latest minor version: $latest_minor" | ||
fi | ||
- name: Suggest changes | ||
uses: parkerbxyz/suggest-changes@v1 | ||
- name: Suggest Changes | ||
uses: getsentry/action-git-diff-suggestions@main | ||
with: | ||
comment: 'If this PR is not intended to update any previous release, please update the VERSION file to the latest version.' | ||
message: 'The version in _quarto.yml is outdated. Please update to the latest version.' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
continue-on-error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters