2021-04-30 21:33:35 +00:00
|
|
|
name: Changelog
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-05-12 18:06:16 +00:00
|
|
|
- main
|
2021-04-30 21:33:35 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: Changelog
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-05-12 18:06:16 +00:00
|
|
|
- name: Check out branch
|
|
|
|
uses: actions/checkout@v2
|
2021-04-30 21:33:35 +00:00
|
|
|
with:
|
2021-05-12 18:06:16 +00:00
|
|
|
fetch-depth: 0 # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
|
2021-04-30 21:33:35 +00:00
|
|
|
|
2021-05-12 18:06:16 +00:00
|
|
|
- name: Set up Node.js 14.x
|
|
|
|
uses: actions/setup-node@v2
|
2021-04-30 21:33:35 +00:00
|
|
|
with:
|
|
|
|
node-version: 14.x
|
2021-07-24 23:00:57 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn --frozen-lockfile --ignore-engines
|
|
|
|
env:
|
|
|
|
CI: true
|
2021-04-30 21:33:35 +00:00
|
|
|
|
2021-08-05 20:39:55 +00:00
|
|
|
- name: Create Release Pull Request or Publish to npm
|
|
|
|
id: changesets
|
2021-04-30 21:33:35 +00:00
|
|
|
uses: changesets/action@master
|
2021-08-05 20:39:55 +00:00
|
|
|
with:
|
|
|
|
# This expects you to have a script called release which does a build for your packages and calls changeset publish
|
|
|
|
publish: yarn release
|
2021-04-30 21:33:35 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-08-05 20:39:55 +00:00
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
2021-08-06 06:01:18 +00:00
|
|
|
|
|
|
|
- name: Send a Discord notification if a publish happens
|
2021-08-06 06:19:54 +00:00
|
|
|
if: steps.changesets.outputs.published == 'true'
|
2021-08-06 06:01:18 +00:00
|
|
|
env:
|
|
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
|
|
uses: Ilshidur/action-discord@0.3.2
|
|
|
|
with:
|
2021-08-06 06:15:34 +00:00
|
|
|
args: 'A new release just went out! [Release notes →](<https://github.com/snowpackjs/astro/releases/>)'
|