Skip to content
Merged
Show file tree
Hide file tree
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
30 changes: 19 additions & 11 deletions .github/workflows/release-version-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ jobs:

- name: Get release information
id: get_release
uses: dawidd6/action-get-latest-release@v3
with:
release: true
run: |
response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/latest)
echo "$response" | jq '.tag_name, .name, .published_at, .body, .html_url' | tee /tmp/release_info
echo "::set-output name=tag_name::$(echo "$response" | jq -r .tag_name)"
echo "::set-output name=name::$(echo "$response" | jq -r .name)"
echo "::set-output name=published_at::$(echo "$response" | jq -r .published_at)"
echo "::set-output name=body::$(echo "$response" | jq -r .body)"
echo "::set-output name=html_url::$(echo "$response" | jq -r .html_url)"


- name: Update version.json
run: |
Expand All @@ -25,7 +31,7 @@ jobs:
"release_name": "${{ steps.get_release.outputs.name }}",
"published_at": "${{ steps.get_release.outputs.published_at }}",
"body": "${{ steps.get_release.outputs.body }}"
"release_url": "${{ steps.get_release.outputs.html_url }}"
"html_url": "${{ steps.get_release.outputs.html_url }}"
}' > version.json

- name: Create new branch
Expand All @@ -41,10 +47,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-version-${{ steps.get_release.outputs.tag_name }}
title: "Update version.json for release ${{ steps.get_release.outputs.tag_name }}"
body: "This PR updates version.json with the latest release information."
base: develop # Target branch for the pull request
run: |
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/pulls \
-d '{
"title": "Update version.json for release ${{ steps.get_release.outputs.tag_name }}",
"body": "This PR updates version.json with the latest release information.",
"head": "update-version-${{ steps.get_release.outputs.tag_name }}",
"base": "develop"
}'
2 changes: 1 addition & 1 deletion src/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ <h4 class="ui inverted header">CodaBench</h4>
</div>
{% if VERSION_INFO.tag_name != 'invalid' and VERSION_INFO.tag_name != 'unknown' %}
<div id="version">
<a href="{{ VERSION_INFO.release_url }}" target="_blank">{{ VERSION_INFO.tag_name }}</a>
<a href="{{ VERSION_INFO.html_url }}" target="_blank">{{ VERSION_INFO.tag_name }}</a>
</div>
{% endif %}
</div>
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"release_name": "Release 1.11.0",
"published_at": "2024-09-16",
"body": "",
"release_url": "https://github.com/codalab/codabench/releases/tag/v1.11.0"
"html_url": "https://github.com/codalab/codabench/releases/tag/v1.11.0"
}