Upgpkg Dae SPEC Version #614
This file contains hidden or 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
| name: Upgpkg Dae SPEC Version | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 */1 * *' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| ref: dae | |
| - name: Get Current Version | |
| run: | | |
| CURRENT_VERSION=`grep -E '^Version:' *.spec | awk '{print $2}'` | |
| echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV | |
| - name: Export latest dae version | |
| run: | | |
| NEW_VERSION="" | |
| for attempt in $(seq 1 5); do | |
| NEW_VERSION=$(curl -fsS https://api.github.com/repos/daeuniverse/dae/releases/latest | jq -r '.tag_name' | sed 's/v//g' || true) | |
| if [ -n "$NEW_VERSION" ] && [ "$NEW_VERSION" != "null" ]; then | |
| break | |
| fi | |
| if [ "$attempt" -lt 5 ]; then | |
| echo "Attempt $attempt failed, retrying in 10 seconds..." | |
| sleep 10 | |
| fi | |
| done | |
| if [ -z "$NEW_VERSION" ] || [ "$NEW_VERSION" = "null" ] ; then | |
| echo "NEW_VERSION is empty, stopping the workflow" | |
| exit 1 | |
| fi | |
| echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV | |
| - name: Run rpmdev-bumpspec action | |
| if: ${{ env.CURRENT_VERSION != env.NEW_VERSION }} | |
| uses: netoarmando/rpmdev-bumpspec-action@v1 | |
| with: | |
| specfile: 'dae.spec' | |
| new: ${{ env.NEW_VERSION }} | |
| userstring: "zhullyb <zhullyb@outlook.com>" | |
| - name: Commit changes | |
| if: ${{ env.CURRENT_VERSION != env.NEW_VERSION }} | |
| run: | | |
| git config --local user.email "zhullyb@outlook.com" | |
| git config --local user.name "zhullyb" | |
| git add . | |
| git commit -m "upgpkg: dae@${{ env.NEW_VERSION }}" | |
| git push | |
| - name: trigger copr webhook | |
| if: ${{ env.CURRENT_VERSION != env.NEW_VERSION }} | |
| run: | | |
| curl -X POST ${{ secrets.COPR_HOOK_URL }}dae/ |