Skip to content

Commit

Permalink
Fixing typo in release script
Browse files Browse the repository at this point in the history
  • Loading branch information
lupestro committed Feb 3, 2024
1 parent 5d37b20 commit c52e2a5
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,43 @@ jobs:
# Tag name: ${{ steps.get_vars.outputs.TAG_NAME }}
# Zip name: ${{ steps.get_vars.outputs.ZIP_NAME }}
# Expected Release Download URL: ${{ steps.get_vars.outputs.RELEASE_DOWNLOAD_URL }}
# Expected Release system.json URL: ${{ steps.get_vars.outputs.RELEASE_INSTALL_URL }}
# Stringified system.json contents: ${{ steps.get_vars.outputs.SYSTEM_JSON }}
# Expected Release module.json URL: ${{ steps.get_vars.outputs.RELEASE_INSTALL_URL }}
# Stringified module.json contents: ${{ steps.get_vars.outputs.MODULE_JSON }}
- name: Set up variables
id: get_vars
run: |
TAG=${GITHUB_REF/refs\/tags\//}
echo "TAG_NAME=$TAG" >> $GITHUB_OUTPUT
echo "ZIP_NAME=torch-$TAG.zip" >> $GITHUB_OUTPUT
echo "RELEASE_DOWNLOAD_URL=https://github.com/${{github.repository}}/releases/download/$TAG/torch-$TAG.zip" >> $GITHUB_OUTPUT
echo "RELEASE_INSTALL_URL=https://github.com/${{github.repository}}/releases/download/$TAG/system.json" >> $GITHUB_OUTPUT
JSON=$(cat ./system.json)
echo ::set-output name=SYSTEM_JSON::${JSON//'%'/'%25'}
echo "RELEASE_INSTALL_URL=https://github.com/${{github.repository}}/releases/download/$TAG/module.json" >> $GITHUB_OUTPUT
JSON=$(cat ./module.json)
echo ::set-output name=MODULE::${JSON//'%'/'%25'}
# Run some tests to make sure our `system.json` is correct
# Run some tests to make sure our `module.json` is correct
# Exit before setting up node if not
- name: Verify correct naming
env:
TAG_NAME: ${{ steps.get_vars.outputs.TAG_NAME }}
RELEASE_DOWNLOAD: ${{steps.get_vars.outputs.RELEASE_DOWNLOAD_URL}}
# Extract version and download url from system.json
# Extract version and download url from module.json
# https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson
PACKAGE_VERSION: ${{fromJSON(steps.get_vars.outputs.SYSTEM_JSON).version}}
PACKAGE_DOWNLOAD: ${{fromJSON(steps.get_vars.outputs.SYSTEM_JSON).download}}
PACKAGE_VERSION: ${{fromJSON(steps.get_vars.outputs.MODULE_JSON).version}}
PACKAGE_DOWNLOAD: ${{fromJSON(steps.get_vars.outputs.MODULE_JSON).download}}
run: |
# Validate that the tag being released matches the package version.
if [[ ! $TAG_NAME == release-$PACKAGE_VERSION ]]; then
echo "The system.json version does not match tag name."
echo "system.json: $PACKAGE_VERSION"
echo "The module.json version does not match tag name."
echo "module.json: $PACKAGE_VERSION"
echo "tag name: $TAG_NAME"
echo "Please fix this and push the tag again."
exit 1
fi
# Validate that the package download url matches the release asset that will be created.
if [[ ! $RELEASE_DOWNLOAD == $PACKAGE_DOWNLOAD ]]; then
echo "The system.json download url does not match the created release asset url."
echo "system.json: $PACKAGE_DOWNLOAD"
echo "The module.json download url does not match the created release asset url."
echo "module.json: $PACKAGE_DOWNLOAD"
echo "release asset url: $RELEASE_DOWNLOAD"
echo "Please fix this and push the tag again."
exit 1
Expand Down

0 comments on commit c52e2a5

Please sign in to comment.