Skip to content

Commit

Permalink
Merge pull request #1229 from AmbientRun/fix-release-deploy-flow
Browse files Browse the repository at this point in the history
fix(ci): remove deploy-packages empty commits
  • Loading branch information
philpax authored Dec 20, 2023
2 parents b13f5f1 + a2fefb8 commit d98427b
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions .github/workflows/deploy-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,6 @@ jobs:
- name: Deploy all packages
run: cargo campfire-slim package deploy-all --token ${{ secrets.AMBIENT_CLOUD_DEPLOY_TOKEN }} --include-examples

- name: Commit and push changed files (for branches)
# only commit and push if this is running in a branch
if: startsWith(github.ref, 'refs/heads/')
run: |
base_branch=${GITHUB_REF#refs/heads/}
branch=${base_branch}-deployed-${{ github.sha }}
git config --global user.name "${{ env.BOT_NAME }}"
git config --global user.email "${{ env.BOT_EMAIL }}"
git checkout -b ${branch}
git commit -a -m "Update deployed packages for ${{ github.sha }}"
git push --set-upstream origin ${branch}
pr_url=$(gh pr create --title "Update deployed packages for ${{ github.sha }}" --body "Deployed packages for ${{ github.sha }}" --base ${base_branch} --head ${branch})
gh pr merge --auto --squash --delete-branch ${pr_url}
- name: Commit and push changed files (for nightly builds)
# only commit and push if this is running in a nightly build tag
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-nightly-')
Expand All @@ -72,7 +58,6 @@ jobs:
git config --global user.name "${{ env.BOT_NAME }}"
git config --global user.email "${{ env.BOT_EMAIL }}"
git checkout -b ${branch}
git commit -a -m "Update deployed packages for ${{ github.sha }}"
# switch back to the main branch version
version_majminpat=$(echo ${tag} | sed -E -e 's/^v([0-9]+\.[0-9]+\.[0-9]+).*$/\1/')
Expand All @@ -83,5 +68,5 @@ jobs:
git commit -a -m "Revert version back to ${version}"
git push --set-upstream origin ${branch}
pr_url=$(gh pr create --title "Update deployed packages for ${{ github.sha }}" --body "Deployed packages for ${{ github.sha }}" --base ${base_branch} --head ${branch})
pr_url=$(gh pr create --title "Update version for ${{ github.sha }}" --body "Deployed packages for ${{ github.sha }} and updated version" --base ${base_branch} --head ${branch})
gh pr merge --auto --squash --delete-branch ${pr_url}

0 comments on commit d98427b

Please sign in to comment.