-
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.
Revert "ci: dont cut a nightly if the latest dev commit was the last …
…nightly" this was meant to be a PR 🤦♂️ This reverts commit 1084573.
- Loading branch information
Showing
1 changed file
with
17 additions
and
39 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 |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
if: github.repository == 'remix-run/remix' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
# allows this to be used in the `comment` job below - will be undefined if there's no release necessary | ||
# allows this to be used in the `comment` job below | ||
NEXT_VERSION: ${{ steps.version.outputs.NEXT_VERSION }} | ||
steps: | ||
- name: 🛑 Cancel Previous Runs | ||
|
@@ -40,68 +40,46 @@ jobs: | |
# because we have a yarn.lock and caches efficiently. | ||
uses: bahmutov/npm-install@v1 | ||
|
||
- name: ⤴️ Update Version if needed | ||
- name: ⤴️ Update Version | ||
id: version | ||
shell: bash | ||
run: | | ||
# get latest commit sha | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Remix Run Bot" | ||
SHA=$(git rev-parse HEAD) | ||
SHORT_SHA=${SHA::7} | ||
DATE=$(date '+%Y%m%d') | ||
NEXT_VERSION=0.0.0-nightly-${SHORT_SHA}-${DATE} | ||
echo ::set-output name=NEXT_VERSION::${NEXT_VERSION} | ||
# set up for reuse | ||
NIGHTLY_PREFIX=0.0.0-nightly | ||
NIGHTLY_TAG_PREFIX=v${NIGHTLY_PREFIX}- | ||
# get latest nightly tag | ||
LATEST_NIGHTLY_TAG=$(git tag --sort=-taggerdate | grep ${NIGHTLY_TAG_PREFIX} | head -n 1) | ||
git checkout -b nightly/${NEXT_VERSION} | ||
# check if last commit to dev starts would be the nightly tag we're about to create (minus the date) | ||
# if it is, we'll skip the nightly creation | ||
# if not, we'll create a new nightly tag | ||
if [[ $LATEST_NIGHTLY_TAG == ${NIGHTLY_TAG_PREFIX}${SHORT_SHA}-* ]]; then | ||
echo "🛑 Latest nightly tag is the same as the latest commit sha, skipping nightly release" | ||
if [ -z "$(git status --porcelain)" ]; then | ||
echo "✨" | ||
else | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Remix Run Bot" | ||
DATE=$(date '+%Y%m%d') | ||
NEXT_VERSION=${NIGHTLY_TAG_PREFIX}${SHORT_SHA}-${DATE} | ||
echo ::set-output name=NEXT_VERSION::${NEXT_VERSION} | ||
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 | ||
echo "dirty working directory..." | ||
git add . | ||
git commit -m "dirty working directory..." | ||
fi | ||
yarn run version ${NEXT_VERSION} --skip-prompt | ||
- name: 🏗 Build | ||
if: steps.version.outputs.NEXT_VERSION | ||
run: yarn build | ||
|
||
- name: 🏷 Push Tag | ||
if: steps.version.outputs.NEXT_VERSION | ||
run: git push origin --tags | ||
|
||
- name: 🔐 Setup npm auth | ||
if: steps.version.outputs.NEXT_VERSION | ||
run: | | ||
echo "registry=https://registry.npmjs.org" >> ~/.npmrc | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc | ||
- name: 🚀 Publish | ||
if: steps.version.outputs.NEXT_VERSION | ||
run: npm run publish | ||
|
||
- name: 🐱 Create GitHub release | ||
uses: actions/create-release@v1 | ||
if: steps.version.outputs.NEXT_VERSION | ||
with: | ||
draft: false | ||
prerelease: true | ||
|
@@ -114,7 +92,7 @@ jobs: | |
comment: | ||
needs: [nightly] | ||
name: 🛴 Kick off comment and deployment test workflows | ||
if: github.repository == 'remix-run/remix' && needs.nightly.outputs.NEXT_VERSION | ||
if: github.repository == 'remix-run/remix' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: peter-evans/repository-dispatch@v2 | ||
|