Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci-cd-changes #5

Merged
merged 29 commits into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
06eae6d
attempt at changing CI/CD to avoid unecesary builds
Amateur-God Jun 29, 2024
06abba7
Update version in config.json and build.json
invalid-email-address Jun 29, 2024
f55065e
Update config.json with new image URL and build.json with build date
invalid-email-address Jun 29, 2024
5656896
better handling of version number
Amateur-God Jun 29, 2024
f147f10
Update version and previous_version.txt
invalid-email-address Jun 29, 2024
393aff1
Update config.json with new image URL and build.json with build date
invalid-email-address Jun 29, 2024
43df498
changes to how prettier pushes
Amateur-God Jun 29, 2024
c750550
Prettified Code!
Amateur-God Jun 29, 2024
4f15908
Update config.json with new image URL and build.json with build date
invalid-email-address Jun 29, 2024
906db7c
i beoke the if statement
Amateur-God Jun 29, 2024
0fe6fbf
Merge branch 'ci-cd-changes' of https://github.com/Amateur-God/Hassio…
Amateur-God Jun 29, 2024
e76fccc
Update config.json with new image URL and build.json with build date
invalid-email-address Jun 29, 2024
0f7e1ce
Update config.json with new image URL and build.json with build date
invalid-email-address Jun 29, 2024
05c542b
apaprently didnt correct this
Amateur-God Jun 29, 2024
ee423f8
Merge branch 'ci-cd-changes' of https://github.com/Amateur-God/Hassio…
Amateur-God Jun 29, 2024
747efbd
Prettified Code!
Amateur-God Jun 29, 2024
f2f0d9f
add the new method of pushing commit to fix rebase issue
Amateur-God Jun 29, 2024
981585b
Merge branch 'ci-cd-changes' of https://github.com/Amateur-God/Hassio…
Amateur-God Jun 29, 2024
65de907
Update config.json with new image URL and build.json with build date
invalid-email-address Jun 29, 2024
d05f632
Update config.json with new image URL and build.json with build date
invalid-email-address Jun 29, 2024
3d15f9e
get rid of version checking
Amateur-God Jun 29, 2024
76dfcc4
Update version in config and build files
invalid-email-address Jun 29, 2024
c0e5619
fix commit issues
Amateur-God Jun 29, 2024
5555a1f
fix more commit issues
Amateur-God Jun 29, 2024
4f05cc8
fix some new issues
Amateur-God Jun 29, 2024
5ab24d8
Prettified Code!
Amateur-God Jun 29, 2024
81b37a7
accidentally removed this line
Amateur-God Jun 29, 2024
56f8ffc
Update version in config.json and build.json
invalid-email-address Jun 29, 2024
ae2870a
Update config.json with new image URL and build.json with build date
invalid-email-address Jun 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading