Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
benelan committed Jun 24, 2024
1 parent a12fc96 commit 85be8bd
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions .github/workflows/deploy-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ jobs:
node-version-file: package.json
- name: Sync dev to main
run: |
git rebase --autostash --autosquash origin/dev
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git rebase --autostash origin/dev
git pull --rebase origin main
npm install
npm run build
npm test
git push origin/main
git push origin main
release-please:
if: github.event_name != 'workflow_dispatch'
Expand All @@ -40,11 +43,8 @@ jobs:
- uses: google-github-actions/release-please-action@v3.7.13
id: release
with:
command: manifest
token: ${{ secrets.ADMIN_TOKEN }}
default-branch: ${{ github.ref_name }}
extra-files: |
packages/calcite-components/readme.md
target-branch: ${{ github.ref_name }}
- name: Checkout Repository
if: ${{ steps.release.outputs.releases_created }}
uses: actions/checkout@v4
Expand All @@ -59,6 +59,11 @@ jobs:
registry-url: "https://registry.npmjs.org"
- name: Build Packages and Publish to NPM
if: ${{ steps.release.outputs.releases_created }}
env:
RELEASED_PATHS: ${{ toJSON(steps.release.outputs.paths_released) }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}
run: |
npm install
npm run build
Expand All @@ -68,6 +73,8 @@ jobs:
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
release_commit="$(git rev-parse HEAD)"
# The "|| true" prevents failure if there are no changes
git add packages/calcite-components/src/components.d.ts package-lock.json || true
Expand All @@ -88,20 +95,19 @@ jobs:
npm run util:upload-release-assets -- "$RELEASED_PATHS"
git checkout -b ci/cherry-pick-release-commit origin/dev
git cherry-pick origin/main || true
git checkout --ours \
packages/*/CHANGELOG.md \
packages/calcite-components-angular/projects/component-library/CHANGELOG.md
if ! git cherry-pick "$release_commit"; then
git checkout --theirs \
${{github.workspace}}/packages/*/CHANGELOG.md \
${{github.workspace}}/packages/calcite-components-angular/projects/component-library/CHANGELOG.md
git checkout --theirs
packages/*/package.json \
packages/calcite-components-angular/projects/component-library/package.json
git checkout --theirs
${{github.workspace}}/packages/*/package.json \
${{github.workspace}}/packages/calcite-components-angular/projects/component-library/package.json
git cherry-pick --continue
gh pr create --fill --base "dev" --label "skip visual snapshots"
git cherry-pick --continue
fi
env:
RELEASED_PATHS: ${{ toJSON(steps.release.outputs.paths_released) }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
git push -u origin HEAD
gh pr create --fill --head "ci/cherry-pick-release-commit" --base "dev" \
--label "skip visual snapshots"

0 comments on commit 85be8bd

Please sign in to comment.