Skip to content

Commit

Permalink
Ci-cd-changes (#5)
Browse files Browse the repository at this point in the history
* fix commit issues
--------
Authored-by: Amateur-God <[email protected]>
  • Loading branch information
Amateur-God authored Jun 29, 2024
1 parent db1acb7 commit 267e373
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 12 deletions.
36 changes: 27 additions & 9 deletions .github/workflows/CI-CD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
git add ./${{ matrix.folder }}/config.json ./${{ matrix.folder }}/build.json
if ! git diff-index --quiet HEAD; then
git commit -m "Update version in config.json and build.json"
git pull --rebase origin ${{ github.ref }}
git pull origin ${{ github.ref }}
git push https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:${{ github.ref }}
else
echo "No changes to commit"
Expand Down Expand Up @@ -211,15 +211,21 @@
git add ./${{ matrix.folder }}/config.json ./${{ matrix.folder }}/build.json
if ! git diff-index --quiet HEAD; then
git commit -m "Prettified Code!"
git pull --rebase origin ${{ github.ref }}
git fetch origin
git rebase origin/${{ github.ref }}
if [ $? -ne 0 ]; then
echo "Rebase failed, attempting to resolve conflicts"
git rebase --abort
git pull origin ${{ github.ref }}
fi
git push https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:${{ github.ref }}
else
echo "No changes to commit"
fi
build_main_or_pr:
name: Build ${{ matrix.architecture }} (Main or PR)
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request'
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request')
needs:
information
runs-on: ubuntu-latest
Expand Down Expand Up @@ -458,7 +464,6 @@
name: Create and Push Docker Manifest
runs-on: ubuntu-latest
needs: build_main_or_pr
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4
Expand Down Expand Up @@ -501,7 +506,6 @@
name: Create and Push Docker Manifest
runs-on: ubuntu-latest
needs: build_other_branches
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4
Expand Down Expand Up @@ -571,8 +575,15 @@
echo "No changes to commit"
else
git commit -m "Update config.json with new image URL and build.json with build date"
git pull --rebase origin ${{ github.ref }}
git push
git fetch origin
BRANCH_NAME=$(echo "${{ github.ref }}" | sed 's/refs\/heads\///')
git rebase origin/${BRANCH_NAME}
if [ $? -ne 0 ]; then
echo "Rebase failed, attempting to resolve conflicts"
git rebase --abort
git pull origin ${BRANCH_NAME}
fi
git push https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:${BRANCH_NAME}
fi
update_config_other_branches:
Expand Down Expand Up @@ -605,6 +616,13 @@
echo "No changes to commit"
else
git commit -m "Update config.json with new image URL and build.json with build date"
git pull --rebase origin ${{ github.ref }}
git push
git fetch origin
BRANCH_NAME=$(echo "${{ github.ref }}" | sed 's/refs\/heads\///')
git rebase origin/${BRANCH_NAME}
if [ $? -ne 0 ]; then
echo "Rebase failed, attempting to resolve conflicts"
git rebase --abort
git pull origin ${BRANCH_NAME}
fi
git push https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:${BRANCH_NAME}
fi
4 changes: 2 additions & 2 deletions addons/adb_server/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
},
"squash": true,
"args": {
"BUILD_DATE": "2024-06-29T14:18:58Z",
"BUILD_DATE": "2024-06-29T15:02:19Z",
"BUILD_DESCRIPTION": "A Home Assistant add-on for ADB Server with restricted shell access.",
"BUILD_NAME": "ADB Server",
"BUILD_REF": "main",
"BUILD_REPOSITORY": "github.com/Amateur-God/Hassio-Addons",
"BUILD_VERSION": "1.1.1",
"DEV_BUILD_DATE": "2024-06-29T03:20:42Z"
"DEV_BUILD_DATE": "2024-06-29T15:22:09Z"
}
}
2 changes: 1 addition & 1 deletion addons/adb_server/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ADB Server",
"version": "1.1.1",
"version": "dev-1.1.1",
"slug": "adb_server",
"description": "A Home Assistant add-on for ADB Server with restricted shell access.",
"arch": [
Expand Down
1 change: 1 addition & 0 deletions addons/adb_server/previous_version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.1

0 comments on commit 267e373

Please sign in to comment.