Skip to content

Commit

Permalink
Merge pull request #4108 from ashensw/asgardeo-docs
Browse files Browse the repository at this point in the history
Improve asgardeo docs release workflow
  • Loading branch information
ashensw authored Nov 8, 2023
2 parents f8ba168 + f6a4623 commit 5977cdd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/release-asgardeo-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,36 +59,36 @@ jobs:
run: |
mkdir -p out/asgardeo/docs
cp -r ./en/asgardeo/site/* out/asgardeo/docs/
zip -r asgardeo-docs-$NEW_VERSION.zip ./out
zip -r asgardeo-docs-${{ env.NEW_VERSION }}.zip ./out
- name: Create git tag
run: |
git config user.name $GIT_USERNAME
git config user.email $GIT_USER_EMAIL
git tag "v$NEW_VERSION"
git push "https://$GIT_USERNAME:$GITHUB_TOKEN@github.com/${{ github.repository }}" "v$NEW_VERSION"
git tag "v${{ env.NEW_VERSION }}"
git push "https://$GIT_USERNAME:$GITHUB_TOKEN@github.com/${{ github.repository }}" "v${{ env.NEW_VERSION }}"
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: v$NEW_VERSION
release_name: Asgardeo Docs - v$NEW_VERSION
tag_name: v${{ env.NEW_VERSION }}
release_name: Asgardeo Docs - v${{ env.NEW_VERSION }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./asgardeo-docs-$NEW_VERSION.zip
asset_name: asgardeo-docs-$NEW_VERSION.zip
asset_path: ./asgardeo-docs-${{ env.NEW_VERSION }}.zip
asset_name: asgardeo-docs-${{ env.NEW_VERSION }}.zip
asset_content_type: application/zip

- name: Commit and push new version
run: |
git add VERSION
git commit -m "Increment release version to $NEW_VERSION"
git commit -m "Increment release version to ${{ env.NEW_VERSION }}"
git push "https://$GIT_USERNAME:$GITHUB_TOKEN@github.com/${{ github.repository }}" master
- name: Update Downstream Repository Version
Expand All @@ -105,13 +105,13 @@ jobs:
CURRENT_VERSION_LINE=$(grep "$VERSION_LINE_PREFIX" "$VERSION_FILE_PATH")
# Replacing the current version line with the new version line
NEW_VERSION_LINE="${VERSION_LINE_PREFIX}$NEW_VERSION"
NEW_VERSION_LINE="${VERSION_LINE_PREFIX}${{ env.NEW_VERSION }}"
sed -i "s|$CURRENT_VERSION_LINE|$NEW_VERSION_LINE|" "$VERSION_FILE_PATH"
# Verifying if the file has changed, and if so, committing and pushing it
if git status --porcelain; then
git config user.name $GIT_USERNAME
git config user.email $GIT_USER_EMAIL
git add "$VERSION_FILE_PATH"
git commit -m "[Dev] Update asgardeo-docs release version to $NEW_VERSION"
git commit -m "[Dev] Update asgardeo-docs release version to ${{ env.NEW_VERSION }}"
git push origin $GIT_BRANCH_NAME

0 comments on commit 5977cdd

Please sign in to comment.