-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4108 from ashensw/asgardeo-docs
Improve asgardeo docs release workflow
- Loading branch information
Showing
1 changed file
with
10 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:[email protected]/${{ github.repository }}" "v$NEW_VERSION" | ||
git tag "v${{ env.NEW_VERSION }}" | ||
git push "https://$GIT_USERNAME:[email protected]/${{ 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:[email protected]/${{ github.repository }}" master | ||
- name: Update Downstream Repository Version | ||
|
@@ -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 |