Improve GitHub Actions (#2041)
* chore(actions): test new CI action * chore(actions): switch action order * chore(actions): update registry * chore(actions): remove debug * chore(actions): target all packages * chore(actions): test artifacts * chore(actions): try moving artifacts * chore(actions): test moving * chore(actions): test tar approach * chore(actions): test tar approach * chore(actions): use artifacts/packages before tar * chore(actions): test mv -vn * chore(actions): mkdir first * chore(actions): how does tar work? * chore(actions): so good at bash * chore(actions): test matrix * chore(actions): fix test matrix * chore(actions): fix windows? * chore(actions): fix windows? * chore(actions): fix windows! * chore(actions): fix windows! * chore(actions): add lint * chore(actions): add back old actions * chore(actions): test notification action * chore(actions): test notification action again * chore(actions): fix extract action * chore(actions): fix action? * chore(actions): fix action? * chore(actions): fix newlines * chore(actions): test --production flag * chore(actions): test --production flag for test * chore(actions): add execa to production deps * chore(actions): add cheerio to production deps * chore(actions): add production deps for tested examples * chore(actions): fix changelog action * chore(actions): attempt to use --prefer-offline * chore(actions): revert dependencies/devDependencies change * chore(actions): update all actions * chore(actions): add smoke test * chore(actions): update changelog deps * chore(actions): move notify script * chore(actions): consolidate main scripts * chore(actions): update changelog name * chore(actions): update congratsbot * chore(actions): update ci * chore(actions): change lint/format strategy * chore(actions): expose GITHUB_TOKEN to linter * chore(actions): update lint * chore(actions): enable autofix * chore(actions): fetch-depth 0 * chore(actions): fix eslint extensions * chore(actions): debug lint * chore(actions): fix eslint args * chore(actions): fix eslint? * [ci] ESLint fix * [ci] Prettier fix * chore(actions): fix lint! * chore(actions): cleanup comments * chore(actions): fix lint * chore(actions): lint astro only * chore(actions): ignore pattern * chore(actions): no_verify * chore(actions): disable no verify * chore(actions): debug status * chore(actions): add concurrency * chore(actions): add comment about concurrency * chore(actions): make release dependent on lint * chore(actions): move lint first * chore(actions): run CI on PR or `main` only * chore(actions): remove GPR publish step * chore: add back old actions * chore: revert package.json * chore: improve changelog with GitHub info * chore(actions): try pull_request_target * debug lint * debug lint * debug lint * try pull_request_target * update pull_request_target perms * update pull_request_target * fix perms * fix run? * fix run? * fix run? (part 3) * fix run? (part 4) * fix run? (part 5) * fix run! * fix run!! * fix run!!! * fix run!!!! * fix run!!!!! * fix run!!!!!! * add comment about forks Co-authored-by: GitHub Actions <actions-user@github.com>
This commit is contained in:
parent
0f5e89f694
commit
4067151aec
14 changed files with 326 additions and 189 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json",
|
||||
"changelog": "@changesets/cli/changelog",
|
||||
"changelog": "@changesets/changelog-github",
|
||||
"commit": false,
|
||||
"linked": [["astro", "@astrojs/parser"]],
|
||||
"access": "public",
|
||||
|
|
|
@ -3,4 +3,6 @@
|
|||
!packages/astro/**/*.js
|
||||
!packages/astro/**/*.ts
|
||||
packages/astro/test/**/*.js
|
||||
packages/astro/vendor/vite/**/*
|
||||
packages/astro/vendor/vite/**/*
|
||||
.github
|
||||
.changeset
|
||||
|
|
11
.github/extract-artifacts.sh
vendored
Executable file
11
.github/extract-artifacts.sh
vendored
Executable file
|
@ -0,0 +1,11 @@
|
|||
cd artifacts
|
||||
mkdir -p ../tmp/packages
|
||||
mv * ../tmp/packages
|
||||
cd ../tmp
|
||||
tar -cvzpf artifacts.tar.gz *
|
||||
mv artifacts.tar.gz ../artifacts.tar.gz
|
||||
cd ..
|
||||
tar -xvzpf artifacts.tar.gz
|
||||
rm -rf artifacts
|
||||
rm -rf tmp
|
||||
rm -f artifacts.tar.gz
|
222
.github/workflows/ci.yml
vendored
222
.github/workflows/ci.yml
vendored
|
@ -11,8 +11,98 @@ on:
|
|||
- 'examples/**'
|
||||
- 'www/**'
|
||||
|
||||
permissions:
|
||||
checks: write
|
||||
contents: read
|
||||
|
||||
# Automatically cancel in-progress actions on the same branch
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
# Lint can run in parallel with Build.
|
||||
# We also run `yarn install` with the `--prefer-offline` flag to speed things up.
|
||||
lint:
|
||||
name: Lint
|
||||
# Lint cannot run on forks, so just skip those! See https://github.com/wearerequired/lint-action/issues/13
|
||||
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines
|
||||
env:
|
||||
CI: true
|
||||
|
||||
- name: Status
|
||||
run: git status
|
||||
|
||||
- name: Lint
|
||||
uses: wearerequired/lint-action@v1.10.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
eslint: true
|
||||
eslint_args: --ignore-pattern test --ignore-pattern vendor
|
||||
eslint_dir: packages/astro
|
||||
eslint_extensions: ts
|
||||
prettier: true
|
||||
auto_fix: true
|
||||
git_name: GitHub Action
|
||||
git_email: github-action@users.noreply.github.com
|
||||
commit_message: '[ci] ${linter} fix'
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
neutral_check_on_warning: true
|
||||
|
||||
# Build installs all devDependencies and runs our full build pipeline.
|
||||
# We upload all `dist/` artifacts to GitHub, which can be shared by all dependent jobs.
|
||||
build:
|
||||
name: Build Packages
|
||||
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
||||
env:
|
||||
CI: true
|
||||
|
||||
- name: Build Packages
|
||||
run: yarn build:all
|
||||
|
||||
- name: Upload Package Artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: artifacts
|
||||
path: packages/**/dist/*
|
||||
if-no-files-found: error
|
||||
|
||||
# Test depends on Build's output, which allows us to skip any build process!
|
||||
# We also run `yarn install` with the `--prefer-offline` flag to speed things up.
|
||||
test:
|
||||
name: 'Test: ${{ matrix.os }} (node@${{ matrix.node_version }})'
|
||||
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
|
@ -24,86 +114,114 @@ jobs:
|
|||
- os: macos-latest
|
||||
node_version: 16
|
||||
fail-fast: false
|
||||
env:
|
||||
LANG: en-us
|
||||
name: 'Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
|
||||
needs:
|
||||
- build
|
||||
steps:
|
||||
- name: Check out code using Git
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set Node version to ${{ matrix.node_version }}
|
||||
- name: Setup node@${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Debug
|
||||
run: yarn versions
|
||||
- name: Download Build Artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile --ignore-engines
|
||||
- name: Extract Artifacts
|
||||
run: ./.github/extract-artifacts.sh
|
||||
|
||||
- name: Build Astro
|
||||
run: yarn build:all
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines
|
||||
env:
|
||||
CI: true
|
||||
|
||||
- name: Test
|
||||
run: yarn test
|
||||
|
||||
lint:
|
||||
smoke:
|
||||
name: 'Smoke Test: ${{ matrix.target }}'
|
||||
runs-on: ubuntu-latest
|
||||
name: 'Lint: node-16, ubuntu-latest'
|
||||
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
|
||||
strategy:
|
||||
matrix:
|
||||
target: [docs, www]
|
||||
needs:
|
||||
- build
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set Node version to 16
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Debug
|
||||
run: yarn versions
|
||||
- name: Download Build Artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile --ignore-engines
|
||||
- name: Extract Artifacts
|
||||
run: ./.github/extract-artifacts.sh
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
||||
env:
|
||||
CI: true
|
||||
|
||||
- name: Build
|
||||
run: yarn build:all
|
||||
run: yarn build
|
||||
working-directory: ${{ matrix.target }}
|
||||
|
||||
- name: Lint
|
||||
run: yarn lint
|
||||
# Changelog can only run _after_ Build and Test.
|
||||
# We download all `dist/` artifacts from GitHub to skip the build process.
|
||||
changelog:
|
||||
name: Changelog PR or Release
|
||||
if: ${{ !contains(github.event.head_commit.message, '[skip-ci]') && github.ref_name == 'main' && github.repository_owner == 'withastro' }}
|
||||
needs: [lint, test, smoke]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# NOTE: temporarily disabled until `next` branch can build docs again
|
||||
# smoke:
|
||||
# runs-on: ubuntu-latest
|
||||
# name: 'Smoke: node-14, ubuntu-latest'
|
||||
# steps:
|
||||
# - name: Check out code using Git
|
||||
# uses: actions/checkout@v2
|
||||
# with:
|
||||
# fetch-depth: 0
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Download Build Artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
|
||||
# - name: Set Node version to 16
|
||||
# uses: actions/setup-node@v2
|
||||
# with:
|
||||
# node-version: 16
|
||||
# cache: 'yarn'
|
||||
- name: Extract Artifacts
|
||||
run: ./.github/extract-artifacts.sh
|
||||
|
||||
# - name: Debug
|
||||
# run: yarn versions
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines
|
||||
env:
|
||||
CI: true
|
||||
|
||||
- name: Create Release Pull Request or Publish
|
||||
id: changesets
|
||||
uses: changesets/action@master
|
||||
with:
|
||||
publish: changeset publish
|
||||
commit: '[ci] release'
|
||||
title: '[ci] release'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
# - name: Install dependencies
|
||||
# run: yarn install --frozen-lockfile --ignore-engines
|
||||
- name: Generate Notification
|
||||
id: notification
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
run: message=$(node scripts/notify/index.js '${{ steps.changesets.outputs.publishedPackages }}') && echo ::set-output name=message::${message//$'\n'/'%0A'}
|
||||
|
||||
# - name: Build
|
||||
# run: yarn build:all
|
||||
|
||||
# - name: "Smoke Test: Build 'docs'"
|
||||
# run: yarn build
|
||||
# working-directory: ./docs
|
||||
|
||||
# - name: "Smoke Test: Build 'www'"
|
||||
# run: yarn build
|
||||
# working-directory: ./www
|
||||
- name: Discord Notification
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
id: discord-notification
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
uses: Ilshidur/action-discord@0.3.2
|
||||
with:
|
||||
args: ${{ steps.notification.outputs.message }}
|
||||
|
|
24
.github/workflows/congratsbot.yml
vendored
24
.github/workflows/congratsbot.yml
vendored
|
@ -1,24 +0,0 @@
|
|||
name: "Discord:congratsbot"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
congrats:
|
||||
name: "discord:congratsbot"
|
||||
if: github.repository == 'withastro/astro'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: setup
|
||||
run: |
|
||||
TRIMMED=$(echo "${{ github.event.commits[0].message }}" | sed '1!d;q')
|
||||
echo "::set-output name=COMMIT_MSG::${TRIMMED}"
|
||||
- name: Send a Discord notification when a PR is merged
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CONGRATS }}
|
||||
# DISCORD_AVATAR: ${{ github.event.pull_request.user.avatar_url }}
|
||||
uses: Ilshidur/action-discord@0.3.2
|
||||
with:
|
||||
args: '**Sweet!** <${{ github.event.commits[0].author.name }}> just merged ["\"${{ steps.setup.outputs.COMMIT_MSG }}\""](<https://github.com/withastro/astro/commits/main>) ```${{ github.event.commits[0].message }}```'
|
1
.github/workflows/label.yml
vendored
1
.github/workflows/label.yml
vendored
|
@ -8,6 +8,7 @@ on:
|
|||
jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'withastro'
|
||||
steps:
|
||||
- uses: actions/labeler@v3
|
||||
with:
|
||||
|
|
83
.github/workflows/main.yml
vendored
Normal file
83
.github/workflows/main.yml
vendored
Normal file
|
@ -0,0 +1,83 @@
|
|||
name: Main Checks
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Automatically cancel in-progress actions on the same branch
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
congrats:
|
||||
name: congratsbot
|
||||
if: ${{ github.repository_owner == 'withastro' && !contains(github.event.head_commit.message, '[skip-ci]') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: setup
|
||||
run: |
|
||||
TRIMMED=$(echo "${{ github.event.commits[0].message }}" | sed '1!d;q')
|
||||
echo "::set-output name=COMMIT_MSG::${TRIMMED}"
|
||||
- name: Send a Discord notification when a PR is merged
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CONGRATS }}
|
||||
# DISCORD_AVATAR: ${{ github.event.pull_request.user.avatar_url }}
|
||||
uses: Ilshidur/action-discord@0.3.2
|
||||
with:
|
||||
args: '**Sweet!** <${{ github.event.commits[0].author.name }}> just merged ["\"${{ steps.setup.outputs.COMMIT_MSG }}\""](<https://github.com/withastro/astro/commits/main>) ```${{ github.event.commits[0].message }}```'
|
||||
|
||||
check_for_update:
|
||||
name: Check for Updates
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
run_job: ${{ steps.check_files.outputs.run_job }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines
|
||||
env:
|
||||
CI: true
|
||||
|
||||
- name: Check Modified
|
||||
run: yarn changeset status --output ./status.json
|
||||
|
||||
- name: Check Output
|
||||
id: check_files
|
||||
run: |
|
||||
output=`echo $(cat status.json)`
|
||||
if [[ $output = '{ "changesets": [], "releases": [] }' ]]
|
||||
then
|
||||
echo 'No changeset found'
|
||||
echo "::set-output name=run_job::true"
|
||||
else
|
||||
echo 'changes found, push to latest skipped'
|
||||
echo "::set-output name=run_job::false"
|
||||
fi
|
||||
|
||||
update:
|
||||
name: Update the latest branch
|
||||
needs: check_for_update
|
||||
if: needs.check_for_update.outputs.run_job == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Push
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: latest
|
53
.github/workflows/release.yml
vendored
53
.github/workflows/release.yml
vendored
|
@ -1,53 +0,0 @@
|
|||
name: Changelog
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Changelog
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code using Git
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0 # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
|
||||
|
||||
- name: Set Node version to 14
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14.x
|
||||
cache: 'yarn'
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn --frozen-lockfile --ignore-engines
|
||||
env:
|
||||
CI: true
|
||||
|
||||
- name: Create Release Pull Request or Publish to npm
|
||||
id: changesets
|
||||
uses: changesets/action@master
|
||||
with:
|
||||
# This expects you to have a script called release which does a build for your packages and calls changeset publish
|
||||
publish: yarn release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Send a Discord notification if a publish happens
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
id: discord-notification
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
uses: Ilshidur/action-discord@0.3.2
|
||||
with:
|
||||
args: 'A new release just went out! [Release notes →](<https://github.com/withastro/astro/releases/>)'
|
||||
|
||||
- name: push main branch to latest branch
|
||||
if: steps.changesets.outputs.published == 'true'
|
||||
id: git-push-latest
|
||||
# Note: this will fail if "latest" and "main" have different commit history,
|
||||
# which is a good thing! Also, don't push if in pre-release mode.
|
||||
run: '(test -f .changeset/pre.json && echo "prerelease: skip pushing to latest branch.") || git push origin main:latest'
|
2
.github/workflows/stat.yml
vendored
2
.github/workflows/stat.yml
vendored
|
@ -7,7 +7,7 @@ on:
|
|||
|
||||
jobs:
|
||||
stat:
|
||||
if: github.repository == 'withastro/astro'
|
||||
if: github.repository_owner == 'withastro'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code using Git
|
||||
|
|
54
.github/workflows/updatelatest.yml
vendored
54
.github/workflows/updatelatest.yml
vendored
|
@ -1,54 +0,0 @@
|
|||
name: 'Update Latest from main'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
jobs:
|
||||
update:
|
||||
name: check for updates in .changeset
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
run_job: ${{ steps.check_files.outputs.run_job }}
|
||||
steps:
|
||||
- name: checkout git branch
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install all dependencies
|
||||
run: yarn
|
||||
|
||||
- name: check modified files
|
||||
run: npx changeset status --output ./status.json
|
||||
|
||||
- name: check output
|
||||
id: check_files
|
||||
run: |
|
||||
output=`echo $(cat status.json)`
|
||||
if [[ $output = '{ "changesets": [], "releases": [] }' ]]
|
||||
then
|
||||
echo 'No changeset found'
|
||||
echo "::set-output name=run_job::true"
|
||||
else
|
||||
echo 'changes found, push to latest skipped'
|
||||
echo "::set-output name=run_job::false"
|
||||
fi
|
||||
|
||||
|
||||
update_latest_branch:
|
||||
name: Update the latest branch
|
||||
needs: update
|
||||
if: needs.update.outputs.run_job == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Push
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: latest
|
|
@ -42,6 +42,7 @@
|
|||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@changesets/changelog-github": "^0.4.2",
|
||||
"@changesets/cli": "^2.16.0",
|
||||
"@octokit/action": "^3.15.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
||||
|
|
|
@ -29,7 +29,7 @@ export class Parser {
|
|||
js: Script[] = [];
|
||||
meta_tags = {};
|
||||
last_auto_closed_tag?: LastAutoClosedTag;
|
||||
feature_flags: number = 0;
|
||||
feature_flags = 0;
|
||||
|
||||
constructor(template: string, options: ParserOptions) {
|
||||
if (typeof template !== 'string') {
|
||||
|
|
25
scripts/notify/index.js
Executable file
25
scripts/notify/index.js
Executable file
|
@ -0,0 +1,25 @@
|
|||
const path = require('path');
|
||||
const baseUrl = new URL('https://github.com/withastro/astro/blob/main/');
|
||||
|
||||
async function run() {
|
||||
const releases = process.argv.slice(2)[0];
|
||||
const data = JSON.parse(releases);
|
||||
const packages = await Promise.all(
|
||||
data.map(({ name, version }) => {
|
||||
const p = path.relative('./', path.dirname(require.resolve(name))).replace(path.sep, '/');
|
||||
return { name, version, url: new URL(`${p}/CHANGELOG.md#${version.replace(/\./g, '')}`, baseUrl).toString() };
|
||||
})
|
||||
);
|
||||
|
||||
if (packages.length === 1) {
|
||||
const { name, version, url } = packages[0];
|
||||
console.log(`\`${name}@${version}\` was just released! Read the [release notes →](<${url}>)`);
|
||||
} else {
|
||||
console.log(`**Some new releases just went out!**\n`);
|
||||
for (const { name, version, url } of packages) {
|
||||
console.log(` • \`${name}@${version}\` ([Release Notes →](<${url}>))`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
31
yarn.lock
31
yarn.lock
|
@ -1142,6 +1142,15 @@
|
|||
"@manypkg/get-packages" "^1.0.1"
|
||||
semver "^5.4.1"
|
||||
|
||||
"@changesets/changelog-github@^0.4.2":
|
||||
version "0.4.2"
|
||||
resolved "https://registry.yarnpkg.com/@changesets/changelog-github/-/changelog-github-0.4.2.tgz#359eb4b7485eddc55855f8793811817d5124dfab"
|
||||
integrity sha512-qq8lJcq91ki7UT0fIfIcn5Yy7GJj19TmkLmGZ24/wEfxcD/nHHoTNRoi6nPt+Htf7qEudKxXLzQLi41B7Mt2vg==
|
||||
dependencies:
|
||||
"@changesets/get-github-info" "^0.5.0"
|
||||
"@changesets/types" "^4.0.2"
|
||||
dotenv "^8.1.0"
|
||||
|
||||
"@changesets/cli@^2.16.0":
|
||||
version "2.18.0"
|
||||
resolved "https://registry.yarnpkg.com/@changesets/cli/-/cli-2.18.0.tgz#662e27c78897cf948ca61177df9c915d750b8221"
|
||||
|
@ -1209,6 +1218,14 @@
|
|||
fs-extra "^7.0.1"
|
||||
semver "^5.4.1"
|
||||
|
||||
"@changesets/get-github-info@^0.5.0":
|
||||
version "0.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@changesets/get-github-info/-/get-github-info-0.5.0.tgz#b91ceb2d82edef78ae1598ea9fc335a012250295"
|
||||
integrity sha512-vm5VgHwrxkMkUjFyn3UVNKLbDp9YMHd3vMf1IyJoa/7B+6VpqmtAaXyDS0zBLfN5bhzVCHrRnj4GcZXXcqrFTw==
|
||||
dependencies:
|
||||
dataloader "^1.4.0"
|
||||
node-fetch "^2.5.0"
|
||||
|
||||
"@changesets/get-release-plan@^3.0.2":
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@changesets/get-release-plan/-/get-release-plan-3.0.2.tgz#7e5b264838032b226263f8bfeff4706c255f6d4f"
|
||||
|
@ -1284,6 +1301,11 @@
|
|||
resolved "https://registry.yarnpkg.com/@changesets/types/-/types-4.0.1.tgz#85cf3cc32baff0691112d9d15fc21fbe022c9f0a"
|
||||
integrity sha512-zVfv752D8K2tjyFmxU/vnntQ+dPu+9NupOSguA/2Zuym4tVxRh0ylArgKZ1bOAi2eXfGlZMxJU/kj7uCSI15RQ==
|
||||
|
||||
"@changesets/types@^4.0.2":
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@changesets/types/-/types-4.0.2.tgz#d20e1e45bdc96a97cc509c655e708b53a9292465"
|
||||
integrity sha512-OeDaB7D+WVy/ErymPzFm58IeGvz4DOl+oedyZETfnkfMezF/Uhrm1Ub6MHrO5LcAaQTW+ptDmr0fmaVyoTxgHw==
|
||||
|
||||
"@changesets/write@^0.1.5":
|
||||
version "0.1.5"
|
||||
resolved "https://registry.yarnpkg.com/@changesets/write/-/write-0.1.5.tgz#97574d95c8e48c3bbb1173802672f9a64d1b7fef"
|
||||
|
@ -4310,6 +4332,11 @@ data-uri-to-buffer@^4.0.0:
|
|||
resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz#b5db46aea50f6176428ac05b73be39a57701a64b"
|
||||
integrity sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==
|
||||
|
||||
dataloader@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-1.4.0.tgz#bca11d867f5d3f1b9ed9f737bd15970c65dff5c8"
|
||||
integrity sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==
|
||||
|
||||
dateformat@^3.0.0:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
|
||||
|
@ -4591,7 +4618,7 @@ dotenv-expand@^5.1.0:
|
|||
resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-5.1.0.tgz#3fbaf020bfd794884072ea26b1e9791d45a629f0"
|
||||
integrity sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==
|
||||
|
||||
dotenv@^8.2.0:
|
||||
dotenv@^8.1.0, dotenv@^8.2.0:
|
||||
version "8.6.0"
|
||||
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"
|
||||
integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==
|
||||
|
@ -8265,7 +8292,7 @@ node-fetch@*, node-fetch@^3.0.0:
|
|||
fetch-blob "^3.1.2"
|
||||
formdata-polyfill "^4.0.10"
|
||||
|
||||
node-fetch@^2.6.0, node-fetch@^2.6.1:
|
||||
node-fetch@^2.5.0, node-fetch@^2.6.0, node-fetch@^2.6.1:
|
||||
version "2.6.6"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89"
|
||||
integrity sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==
|
||||
|
|
Loading…
Reference in a new issue