Skip to content

Commit

Permalink
Merge branch 'main' into admin-ui-1846
Browse files Browse the repository at this point in the history
  • Loading branch information
mjatin-dev committed Jan 5, 2025
2 parents ea95c89 + e707ff2 commit 7909d81
Show file tree
Hide file tree
Showing 85 changed files with 630 additions and 662 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ jobs:
sign_cmd: dpkg-sig -s builder -k DE92BEF14A1A4E542F678B64DC3C790386C73900
python_version: "3.8"
- name: el8
asset_suffix: -el8.x86_64.rpm
asset_suffix: .el8.x86_64.rpm
build_files: rpm/el8
asset_prefix: '-'
asset_path: flex/rpmbuild/RPMS/x86_64
sign_cmd: rpm --addsign
python_version: "3.6"
- name: suse15
asset_suffix: -suse15.x86_64.rpm
asset_suffix: .suse15.x86_64.rpm
build_files: rpm/suse15
asset_prefix: '-'
asset_path: flex/rpmbuild/RPMS/x86_64
Expand Down Expand Up @@ -82,12 +82,11 @@ jobs:
- name: Get latest tag
id: previoustag
run: |
echo "version=$(echo ${{ github.event.ref }} | cut -d 'v' -f 2)" >> $GITHUB_OUTPUT
echo "tag=$(echo ${{ github.event.ref }} | cut -d '/' -f 3)" >> $GITHUB_OUTPUT
if [[ ${{ github.event.ref }} == 'refs/tags/nightly' ]]; then
echo "version=0.0.0-nightly" >> $GITHUB_OUTPUT
else
echo "version=$(echo ${{ github.event.ref }} | cut -d 'v' -f 2)" >> $GITHUB_OUTPUT
echo "version=$(echo ${{ github.event.ref }} | cut -d 'v' -f 2)-stable" >> $GITHUB_OUTPUT
fi
echo "PACKAGE_PREFIX=flex" >> ${GITHUB_ENV}
Expand Down Expand Up @@ -124,6 +123,7 @@ jobs:
cd flex/
sed -i "s/%VERSION%/${{ steps.previoustag.outputs.version }}/g" checksum.sh
sudo ./checksum.sh
ls ${{github.workspace}}/${{ matrix.asset_path }}
- name: Upload binaries to release
id: upload_binaries
Expand Down
99 changes: 0 additions & 99 deletions .github/workflows/release-snapshot.yml

This file was deleted.

87 changes: 10 additions & 77 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,22 @@
name: release
on:
workflow_dispatch:
inputs:
jans_release_as:
description: 'Release version for the python projects, admin ui, docker images, and helm charts'
required: true
default: '0.0.0-nightly'
mega_release_as:
description: 'Mega release version'
required: true
default: '0.0.0-nightly'
next_jans_release_as:
description: 'next anticipated jans Mega release version'
required: true
default: '0.0.0-nightly'
next_mega_release_as:
description: 'next anticipated Mega release version'
required: true
default: '0.0.0-nightly'
permissions:
contents: read

jobs:
mega-release-pr:
release-mega-pr:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
- uses: googleapis/release-please-action@v4
id: release-please
with:
gpg_private_key: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.MOAUTO_GPG_PRIVATE_KEY_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true

- name: Configure Git
run: |
git config user.name "mo-auto"
git config user.email "[email protected]"
git config --global user.signingkey "${{ steps.import_gpg.outputs.keyid }}"
git config --global pull.rebase true
- name: Prepare release
run: |
# echo "Install helm docs
mkdir helmtemp
cd helmtemp
HELM_DOCS_VERSION=$(curl "https://api.github.com/repos/norwoodj/helm-docs/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2-)
curl -sSL https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz -o helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz
tar xvf helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz
sudo cp helm-docs /usr/local/bin/
cd ..
rm -rf helmtemp
VERSION=${{ github.event.inputs.mega_release_as }}
JANS_VERSION=${{ github.event.inputs.jans_release_as }}
SETUP_VERSION=${{ github.event.inputs.jans_release_as }}
DOCKER_VERSION=${{ github.event.inputs.jans_release_as }}
ADMIN_UI_VERSION=${{ github.event.inputs.jans_release_as }}
HELM_RELEASE=${{ github.event.inputs.mega_release_as }}
echo "${{ secrets.MOWORKFLOWTOKEN }}" | gh auth login --with-token
git checkout -b chore-$VERSION
git pull origin chore-$VERSION || echo "Nothing to pull"
chmod +x ./automation/release/release.sh
source ./automation/release/release.sh
modify_jans_commit_id
modify_flex_commit_id
git commit -a -S -m "chore: update admin ui and flex version" || echo "Nothing to commit"
modify_version
git commit -a -S -m "chore: modify app_info.json and python version files" || echo "Nothing to commit"
modify_helm_chart
git commit -a -S -m "chore: update flex helm chart image tags" || echo "Nothing to commit"
modify_version_files
git commit -a -S -m "chore: update version files" || echo "Nothing to commit"
# Push the changes to the repository
git push --set-upstream origin chore-$VERSION
MESSAGE="chore: release $VERSION"
PR=$(gh pr create --body "Auto generated $VERSION release" --title "${MESSAGE}" --label "autorelease:pending" || echo "PR already exists")
# Report it in RocketChat
curl -X POST -H 'Content-Type: application/json' --data "{\"alias\":\"Mo-Auto\",\"emoji\":\":robot:\",\"text\":\":rocket: I am getting ready for releasing Flex $VERSION.\",\"attachments\":[{\"title\":\"Gluu Release bot\",\"title_link\":\"$PR\",\"text\":\"$PR\",\"color\":\"#764FA5\"}]}" ${{ secrets.GITHUBUSERBEHAVIORROCKETCHATREPORTER }}
release-type: simple
token: ${{ secrets.MOWORKFLOWTOKEN }}
Loading

0 comments on commit 7909d81

Please sign in to comment.