This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
Client for Latest Release Version #23
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
on: | |
schedule: | |
- cron: '0 1 * * *' | |
name: Client for Latest Release Version | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
branch: [dev] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ matrix.branch }} | |
- name: Check Client Version | |
run: | | |
version=$(curl -s https://api.github.com/repos/jumpserver/clients/releases/latest | jq -r .tag_name) | |
echo "version=${version}" >> $GITHUB_ENV | |
sed -i "s/Client_VERSION=.*/Client_VERSION=${version}/g" prepare.sh | |
git diff --exit-code || echo "need_update=1" >> $GITHUB_ENV | |
git checkout -b pr@dev@upgrade_client_${version} | |
- name: Update Client Version | |
if: env.need_update == '1' | |
run: | | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git add . | |
git commit -m "Update Client Version to ${{ env.version }}" | |
git push origin pr@${{ matrix.branch }}@upgrade_client_${{ env.version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |