-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(nightly): move git operations after build (#4814)
* ci(nightly): move git operations after build when adding deno typechecking (#4715), nightly now refers to the version we just calculated which hasnt been published when trying to build and typecheck Signed-off-by: Logan McAnsh <[email protected]> * ci: update tmp branch name Signed-off-by: Logan McAnsh <[email protected]> Signed-off-by: Logan McAnsh <[email protected]> (cherry picked from commit c9413eb)
- Loading branch information
1 parent
a23a6d4
commit 39cb007
Showing
1 changed file
with
14 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,38 +46,28 @@ jobs: | |
- name: 📥 Install deps | ||
run: yarn --frozen-lockfile | ||
|
||
- name: ⤴️ Update Version if needed | ||
- name: 🕵️ Check for changes | ||
id: version | ||
run: | | ||
# get latest commit sha | ||
SHA=$(git rev-parse HEAD) | ||
# get first 7 characters of sha | ||
SHORT_SHA=${SHA::7} | ||
# get latest nightly tag | ||
LATEST_NIGHTLY_TAG=$(git tag -l v0.0.0-nightly-\* --sort=-committerdate | head -n 1) | ||
# get changes since last nightly | ||
CHANGES=$(git diff $LATEST_NIGHTLY_TAG..dev -- ./packages/ -- ':!packages/**/package.json') | ||
# check if there are changes to ./packages | ||
if [[ -n $(echo $CHANGES | xargs) ]]; then | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Remix Run Bot" | ||
# yyyyMMdd format (e.g. 20221207) | ||
DATE=$(date '+%Y%m%d') | ||
# v0.0.0-nightly-<short sha>-<date> | ||
NEXT_VERSION=0.0.0-nightly-${SHORT_SHA}-${DATE} | ||
# set output so it can be used in other jobs | ||
echo "NEXT_VERSION=${NEXT_VERSION}" >> $GITHUB_OUTPUT | ||
git checkout -b nightly/${NEXT_VERSION} | ||
if [ -z "$(git status --porcelain)" ]; then | ||
echo "✨" | ||
else | ||
echo "dirty working directory..." | ||
git add . | ||
git commit -m "dirty working directory..." | ||
fi | ||
yarn run version ${NEXT_VERSION} --skip-prompt | ||
else | ||
echo "🛑 no changes since last nightly, skipping..." | ||
fi | ||
|
@@ -86,6 +76,14 @@ jobs: | |
if: steps.version.outputs.NEXT_VERSION | ||
run: yarn build | ||
|
||
- name: ⤴️ Update version | ||
if: steps.version.outputs.NEXT_VERSION | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Remix Run Bot" | ||
git checkout -b nightly/${steps.version.outputs.NEXT_VERSION} | ||
yarn run version ${steps.version.outputs.NEXT_VERSION} --skip-prompt | ||
- name: 🏷 Push Tag | ||
if: steps.version.outputs.NEXT_VERSION | ||
run: git push origin --tags | ||
|