Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasGeiselmann authored Jul 7, 2022
2 parents f1b40fe + b928040 commit 3dd7190
Show file tree
Hide file tree
Showing 406 changed files with 8,355 additions and 3,316 deletions.
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
.tmp
/playground
**/__tests__/fixtures
**/__tests__/**/*/fixtures

# deno
# Deno
integration/helpers/deno-template
packages/remix-deno
templates/deno
98 changes: 62 additions & 36 deletions .github/workflows/deployments.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
name: 🚀 Deployment Tests

on:
repository_dispatch:
types: [release]
workflow_call:
secrets:
TEST_AWS_ACCESS_KEY_ID:
required: true
TEST_AWS_SECRET_ACCESS_KEY:
required: true
TEST_CF_ACCOUNT_ID:
required: true
TEST_CF_GLOBAL_API_KEY:
required: true
TEST_CF_EMAIL:
required: true
TEST_CF_PAGES_API_TOKEN:
required: true
TEST_CF_API_TOKEN:
required: true
TEST_DENO_DEPLOY_TOKEN:
required: true
TEST_FLY_TOKEN:
required: true
TEST_NETLIFY_TOKEN:
required: true
TEST_VERCEL_TOKEN:
required: true
TEST_VERCEL_USER_ID:
required: true

jobs:
arc_deploy:
Expand All @@ -20,6 +44,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -29,10 +55,8 @@ jobs:
working-directory: ./scripts/deployment-test

- name: 📥 Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: 🚀 Deploy to Arc
run: node ./arc.mjs
Expand All @@ -57,6 +81,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -66,19 +92,17 @@ jobs:
working-directory: ./scripts/deployment-test

- name: 📥 Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: 🚀 Deploy to Cloudflare Pages
run: node ./cf-pages.mjs
working-directory: ./scripts/deployment-test
env:
CF_ACCOUNT_ID: ${{ secrets.TEST_CF_ACCOUNT_ID }}
CF_GLOBAL_API_KEY: ${{ secrets.TEST_CF_GLOBAL_API_KEY }}
CF_EMAIL: ${{ secrets.TEST_CF_EMAIL }}
GITHUB_TOKEN: ${{ secrets.TEST_CF_GITHUB_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CF_ACCOUNT_ID }}
CLOUDFLARE_GLOBAL_API_KEY: ${{ secrets.TEST_CF_GLOBAL_API_KEY }}
CLOUDFLARE_EMAIL: ${{ secrets.TEST_CF_EMAIL }}
CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CF_PAGES_API_TOKEN }}

cf_workers_deploy:
name: "CF Workers Deploy"
Expand All @@ -95,6 +119,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -104,17 +130,17 @@ jobs:
working-directory: ./scripts/deployment-test

- name: 📥 Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: 🚀 Deploy to Cloudflare Workers
run: node ./cf-workers.mjs
working-directory: ./scripts/deployment-test
env:
CF_ACCOUNT_ID: ${{ secrets.TEST_CF_ACCOUNT_ID }}
CF_API_TOKEN: ${{ secrets.TEST_CF_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CF_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CF_API_TOKEN }}
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }}
CLOUDFLARE_GLOBAL_API_KEY: ${{ secrets.CLOUDFLARE_GLOBAL_API_KEY }}

# "deploy deploy" is not a typo, we are deploying to Deno Deploy
deno_deploy_deploy:
Expand All @@ -132,6 +158,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -141,10 +169,8 @@ jobs:
working-directory: ./scripts/deployment-test

- name: 📥 Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: 🦕 Install Deno
uses: denoland/setup-deno@v1
Expand Down Expand Up @@ -174,6 +200,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -183,10 +211,8 @@ jobs:
working-directory: ./scripts/deployment-test

- name: 📥 Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: 🎈 Install the Fly CLI
run: curl -L https://fly.io/install.sh | FLYCTL_INSTALL=/usr/local sh
Expand All @@ -212,6 +238,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -221,10 +249,8 @@ jobs:
working-directory: ./scripts/deployment-test

- name: 📥 Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: 🚀 Deploy to Netlify
run: node ./netlify.mjs
Expand All @@ -247,6 +273,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
cache-dependency-path: ./scripts/deployment-test/package.json # no lockfile, key caching off package.json

# some deployment targets require the latest version of npm
# TODO: remove this eventually when the default version we get
Expand All @@ -256,10 +284,8 @@ jobs:
working-directory: ./scripts/deployment-test

- name: 📥 Install deployment-test deps
uses: bahmutov/npm-install@v1
with:
working-directory: ./scripts/deployment-test
useLockFile: false
run: npm install
working-directory: ./scripts/deployment-test

- name: 🚀 Deploy to Vercel
run: node ./vercel.mjs
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,21 @@ jobs:
cache: "yarn"

- name: 📥 Install deps
# even though this is called "npm-install" it does use yarn to install
# because we have a yarn.lock and caches efficiently.
uses: bahmutov/npm-install@v1
run: yarn --frozen-lockfile

- name: 🔗 Convert Docs links to references
run: node scripts/markdown-references.mjs

- name: 👔 Format
run: npm run format --if-present
run: yarn format

- name: 🦕 Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x

- name: 👔 Format Deno files
run: yarn format:deno

- name: 💪 Commit
run: |
Expand Down
104 changes: 65 additions & 39 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
# allows this to be used in the `comment` job below - will be undefined if there's no release necessary
NEXT_VERSION: ${{ steps.version.outputs.NEXT_VERSION }}
steps:
- name: 🛑 Cancel Previous Runs
Expand All @@ -36,67 +36,93 @@ jobs:
cache: "yarn"

- name: 📥 Install deps
# even though this is called "npm-install" it does use yarn to install
# because we have a yarn.lock and caches efficiently.
uses: bahmutov/npm-install@v1
run: yarn --frozen-lockfile

- name: ⤴️ Update Version
- name: ⤴️ Update Version if needed
id: version
run: |
git config --local user.email "[email protected]"
git config --local user.name "Remix Run Bot"
# get latest commit sha
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}
git checkout -b nightly/${NEXT_VERSION}
# get latest nightly tag
LATEST_NIGHTLY_TAG=$(git tag -l v0.0.0-nightly-\* --sort=-taggerdate | head -n 1)
if [ -z "$(git status --porcelain)" ]; then
echo "✨"
# 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} == v0.0.0-nightly-${SHORT_SHA}-* ]]; then
echo "🛑 Latest nightly tag is the same as the latest commit sha, skipping nightly release"
else
echo "dirty working directory..."
git add .
git commit -m "dirty working directory..."
fi
git config --local user.email "[email protected]"
git config --local user.name "Remix Run Bot"
DATE=$(date '+%Y%m%d')
NEXT_VERSION=0.0.0-nightly-${SHORT_SHA}-${DATE}
echo ::set-output name=NEXT_VERSION::${NEXT_VERSION}
git checkout -b nightly/${NEXT_VERSION}
yarn run version ${NEXT_VERSION} --skip-prompt
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
fi
- 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
with:
draft: false
prerelease: true
release_name: v${{ steps.version.outputs.NEXT_VERSION }}
tag_name: v${{ steps.version.outputs.NEXT_VERSION }}
env:
# need this token in order to have it trigger the comment and deployment test workflows
GITHUB_TOKEN: ${{ secrets.NIGHTLY_PAT }}

comment:
needs: [nightly]
name: 🛴 Kick off comment and deployment test workflows
if: github.repository == 'remix-run/remix'
runs-on: ubuntu-latest
steps:
- uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.NIGHTLY_PAT }}
event-type: release
client-payload: '{ "ref": "refs/tags/v${{ needs.nightly.outputs.NEXT_VERSION }}", "version": "${{ needs.nightly.outputs.NEXT_VERSION }}" }'
name: 📝 Comment on related issues and pull requests
if: github.repository == 'remix-run/remix' && needs.nightly.outputs.NEXT_VERSION
uses: remix-run/remix/.github/workflows/release-comments.yml@main
with:
ref: "refs/tags/v${{ needs.nightly.outputs.NEXT_VERSION }}"

deployments:
needs: [nightly]
name: 🚀 Deployment Tests
if: github.repository == 'remix-run/remix' && needs.nightly.outputs.NEXT_VERSION
uses: remix-run/remix/.github/workflows/deployments.yml@main
secrets:
TEST_AWS_ACCESS_KEY_ID: ${{ secrets.TEST_AWS_ACCESS_KEY_ID }}
TEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.TEST_AWS_SECRET_ACCESS_KEY }}
TEST_CF_ACCOUNT_ID: ${{ secrets.TEST_CF_ACCOUNT_ID }}
TEST_CF_GLOBAL_API_KEY: ${{ secrets.TEST_CF_GLOBAL_API_KEY }}
TEST_CF_EMAIL: ${{ secrets.TEST_CF_EMAIL }}
TEST_CF_PAGES_API_TOKEN: ${{ secrets.TEST_CF_PAGES_API_TOKEN }}
TEST_CF_API_TOKEN: ${{ secrets.TEST_CF_API_TOKEN }}
TEST_DENO_DEPLOY_TOKEN: ${{ secrets.TEST_DENO_DEPLOY_TOKEN }}
TEST_FLY_TOKEN: ${{ secrets.TEST_FLY_TOKEN }}
TEST_NETLIFY_TOKEN: ${{ secrets.TEST_NETLIFY_TOKEN }}
TEST_VERCEL_TOKEN: ${{ secrets.TEST_VERCEL_TOKEN }}
TEST_VERCEL_USER_ID: ${{ secrets.TEST_VERCEL_USER_ID }}

stacks:
needs: [nightly]
name: 🥞 Remix Stacks Test
if: github.repository == 'remix-run/remix' && needs.nightly.outputs.NEXT_VERSION
uses: remix-run/remix/.github/workflows/stacks.yml@main
with:
version: "${{ needs.nightly.outputs.NEXT_VERSION }}"
Loading

0 comments on commit 3dd7190

Please sign in to comment.