2023-05-15 21:26:21 +00:00
name : release
on :
issue_comment :
types : [ created]
env :
# 7 GiB by default on GitHub, setting to 6 GiB
NODE_OPTIONS : --max-old-space-size=6144
2023-06-02 17:14:21 +00:00
permissions :
contents : read
2023-05-15 21:26:21 +00:00
jobs :
release-pr :
2023-07-20 09:58:58 +00:00
if : github.repository == 'nuxt/nuxt' && github.event.issue.pull_request && github.event.comment.body == '/trigger release'
2023-05-15 21:26:21 +00:00
permissions :
id-token : write
2023-05-15 21:53:25 +00:00
pull-requests : write
2023-05-15 21:26:21 +00:00
runs-on : ubuntu-latest
timeout-minutes : 20
steps :
- name : Ensure action is by maintainer
2023-06-08 22:24:21 +00:00
uses : octokit/request-action@89697eb6635e52c6e1e5559f15b5c91ba5100cb0 # v2.1.9
2023-05-15 21:26:21 +00:00
id : check_role
with :
2023-05-15 21:31:14 +00:00
route : GET /repos/nuxt/nuxt/collaborators/${{ github.event.comment.user.login }}
2023-05-15 21:26:21 +00:00
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2023-10-18 09:06:36 +00:00
- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2023-05-15 21:26:21 +00:00
with :
2023-05-17 10:17:39 +00:00
ref : refs/pull/${{ github.event.issue.number }}/merge
2023-05-15 21:26:21 +00:00
fetch-depth : 0
- run : corepack enable
2023-10-24 00:22:16 +00:00
- uses : actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
2023-05-15 21:26:21 +00:00
with :
2023-09-11 22:46:22 +00:00
node-version : 20
2023-05-15 21:26:21 +00:00
cache : "pnpm"
- name : Install dependencies
run : pnpm install
- name : Build
run : pnpm build
- name : Release Edge
2023-05-15 21:56:42 +00:00
run : ./scripts/release-edge.sh pr-${{ github.event.issue.number }}
2023-05-15 21:26:21 +00:00
env :
NODE_AUTH_TOKEN : ${{ secrets.NODE_AUTH_TOKEN }}
NPM_CONFIG_PROVENANCE : true
2023-05-15 21:53:25 +00:00
- name : Post comment
2023-11-13 20:38:51 +00:00
uses : actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0 # v7.0.0
2023-05-15 21:53:25 +00:00
with :
github-token : ${{ secrets.GITHUB_TOKEN }}
script : |
github.rest.issues.createComment({
issue_number : context.issue.number,
owner : context.repo.owner,
repo : context.repo.repo,
2023-10-12 14:17:38 +00:00
body: `:rocket : Release triggered! You can now install [nuxt@npm:nuxt-nightly@pr-${{ github.event.issue.number }}](https://www.npmjs.com/package/nuxt-nightly/v/pr-${{ github.event.issue.number }})`
2023-05-15 21:53:25 +00:00
})