@@ -2,150 +2,17 @@ name: Release
22on :
33 push :
44 branches : [main]
5+ pull_request :
56
67# This will cancel previous runs when a branch or PR is updated
78concurrency :
89 group : ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
910 cancel-in-progress : true
1011
1112jobs :
12- release-please :
13- name : Create Release
14- runs-on : ubuntu-latest
15- outputs :
16- release-pr : ${{ steps.release.outputs.pr }}
17- releases-created : ${{ steps.release.outputs.releases_created }}
18- tag-name : ${{ steps.release.outputs.tag_name }}
19- stdlib-tag-name : ${{ steps.release.outputs.stdlib--tag_name }}
20- steps :
21- -
uses :
GoogleCloudPlatform/[email protected] 22- id : release
23- with :
24- # Explicitly use GITHUB_TOKEN here so Release Please doesn't start a CI run that will fail
25- # The correct CI run is triggered by the `generate-docs` job below when it pushes updated documentation
26- token : ${{ secrets.GITHUB_TOKEN }}
27- command : manifest
28-
29- build-preview :
30- name : Build preview binaries
31- needs : [release-please]
32- if : ${{ needs.release-please.outputs.release-pr }}
33- uses : ./.github/workflows/build-js.yml
34- with :
35- os : ubuntu-latest
36- ref : ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }}
37-
38- generate-docs :
39- name : Generate documentation
40- needs : [release-please, build-preview]
41- if : ${{ needs.release-please.outputs.release-pr }}
42- uses : ./.github/workflows/generate-docs.yml
43- with :
44- ref : ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }}
45- secrets :
46- # This uses WORKFLOW_TOKEN because we want the push to trigger our `ci.yml` runs on the release PR
47- # and the GITHUB_TOKEN is blocked from triggering other workflows.
48- # See https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
49- PUSH_TOKEN : ${{ secrets.WORKFLOW_TOKEN }}
50-
51- upload-preview :
52- name : Upload preview binaries
53- needs : [release-please, build-preview]
54- if : ${{ needs.release-please.outputs.release-pr }}
55- uses : ./.github/workflows/upload-binaries.yml
56- with :
57- tag : preview
58- ref : ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }}
59- secrets :
60- UPLOAD_TOKEN : ${{ secrets.GITHUB_TOKEN }}
61-
62- build-release :
63- name : Build release binaries
64- needs : [release-please]
65- if : ${{ needs.release-please.outputs.releases-created }}
66- uses : ./.github/workflows/build-js.yml
67- with :
68- os : ubuntu-latest
69- ref : ${{ needs.release-please.outputs.tag-name }}
70-
71- upload-release :
72- name : Upload release binaries
73- needs : [release-please, build-release]
74- if : ${{ needs.release-please.outputs.releases-created }}
75- uses : ./.github/workflows/upload-binaries.yml
76- with :
77- tag : ${{ needs.release-please.outputs.tag-name }}
78- ref : ${{ needs.release-please.outputs.tag-name }}
79- secrets :
80- UPLOAD_TOKEN : ${{ secrets.GITHUB_TOKEN }}
81-
82- upload-npm-artifacts :
83- needs : [release-please]
84- if : ${{ needs.release-please.outputs.releases-created }}
85- name : Upload release npm artifacts
86- runs-on : ubuntu-latest
87- outputs :
88- stdlib-download-url : ${{ steps.stdlib-upload.outputs.browser_download_url }}
89- steps :
90- - name : Checkout project
91- uses : actions/checkout@v3
92- with :
93- ref : ${{ needs.release-please.outputs.tag-name }}
94-
95- # Many of these steps are the same as building the compiler for tests
96- - name : Setup Node.js
97- 98- with :
99- node-version : " >=18.15 <19"
100- check-latest : true
101- cache : " npm"
102-
103- - name : Pack stdlib
104- working-directory : ./stdlib
105- # Runs `npm pack` and assigns the filename to an env var we can use later
106- run : |
107- echo "STDLIB_TAR=$(npm pack --json | jq -r '.[0].filename')" >> $GITHUB_ENV
108-
109- - name : Upload stdlib
110- id : stdlib-upload
111- uses :
grain-lang/[email protected] 112- with :
113- token : ${{ secrets.GITHUB_TOKEN }}
114- file : ./stdlib/${{ env.STDLIB_TAR }}
115- asset_name : stdlib.tgz
116- tag : ${{ needs.release-please.outputs.stdlib-tag-name }}
117-
118- dispatch-website :
119- needs : [release-please, upload-release]
120- if : ${{ needs.release-please.outputs.releases-created }}
121- name : Dispatch website release
122- runs-on : ubuntu-latest
123- steps :
124- -
uses :
grain-lang/[email protected] 125- with :
126- workflow : Grain Release
127- token : ${{ secrets.WORKFLOW_TOKEN }}
128- ref : main
129- repo : grain-lang/grain-lang.org
130- tag_input : ${{ needs.release-please.outputs.tag-name }}
131-
132- dispatch-homebrew :
133- needs : [release-please, upload-release]
134- if : ${{ needs.release-please.outputs.releases-created }}
135- name : Dispatch homebrew release
136- runs-on : ubuntu-latest
137- steps :
138- -
uses :
grain-lang/[email protected] 139- with :
140- workflow : Grain Release
141- token : ${{ secrets.WORKFLOW_TOKEN }}
142- ref : main
143- repo : grain-lang/homebrew-tap
144- tag_input : ${{ needs.release-please.outputs.tag-name }}
145-
14613 dispatch-docker :
147- needs : [release-please]
148- if : ${{ needs.release-please.outputs.releases-created }}
14+ # needs: [release-please]
15+ # if: ${{ needs.release-please.outputs.releases-created }}
14916 name : Dispatch Docker builds
15017 runs-on : ubuntu-latest
15118 steps :
@@ -155,23 +22,156 @@ jobs:
15522 token : ${{ secrets.WORKFLOW_TOKEN }}
15623 ref : main
15724 repo : grain-lang/grain
158- tag_input : ${{ needs.release-please.outputs.tag-name }}
159-
160- npm-release-stdlib :
161- needs : [release-please, upload-npm-artifacts]
162- if : ${{ needs.release-please.outputs.releases-created }}
163- name : Publish stdlib to npm registry
164- runs-on : ubuntu-latest
165- steps :
166- - name : Setup NodeJS
167- 168- with :
169- node-version : " >=18.15 <19"
170- check-latest : true
171- registry-url : " https://registry.npmjs.org"
172-
173- - name : Publish to npm
174- run : |
175- npm publish ${{ needs.upload-npm-artifacts.outputs.stdlib-download-url }}
176- env :
177- NODE_AUTH_TOKEN : ${{ secrets.NPM_RELEASE }}
25+ tag_input : ' grain-docker-test'
26+ # release-please:
27+ # name: Create Release
28+ # runs-on: ubuntu-latest
29+ # outputs:
30+ # release-pr: ${{ steps.release.outputs.pr }}
31+ # releases-created: ${{ steps.release.outputs.releases_created }}
32+ # tag-name: ${{ steps.release.outputs.tag_name }}
33+ # stdlib-tag-name: ${{ steps.release.outputs.stdlib--tag_name }}
34+ # steps:
35+ # - uses: GoogleCloudPlatform/[email protected] 36+ # id: release
37+ # with:
38+ # # Explicitly use GITHUB_TOKEN here so Release Please doesn't start a CI run that will fail
39+ # # The correct CI run is triggered by the `generate-docs` job below when it pushes updated documentation
40+ # token: ${{ secrets.GITHUB_TOKEN }}
41+ # command: manifest
42+
43+ # build-preview:
44+ # name: Build preview binaries
45+ # needs: [release-please]
46+ # if: ${{ needs.release-please.outputs.release-pr }}
47+ # uses: ./.github/workflows/build-js.yml
48+ # with:
49+ # os: ubuntu-latest
50+ # ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }}
51+
52+ # generate-docs:
53+ # name: Generate documentation
54+ # needs: [release-please, build-preview]
55+ # if: ${{ needs.release-please.outputs.release-pr }}
56+ # uses: ./.github/workflows/generate-docs.yml
57+ # with:
58+ # ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }}
59+ # secrets:
60+ # # This uses WORKFLOW_TOKEN because we want the push to trigger our `ci.yml` runs on the release PR
61+ # # and the GITHUB_TOKEN is blocked from triggering other workflows.
62+ # # See https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
63+ # PUSH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
64+
65+ # upload-preview:
66+ # name: Upload preview binaries
67+ # needs: [release-please, build-preview]
68+ # if: ${{ needs.release-please.outputs.release-pr }}
69+ # uses: ./.github/workflows/upload-binaries.yml
70+ # with:
71+ # tag: preview
72+ # ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }}
73+ # secrets:
74+ # UPLOAD_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
76+ # build-release:
77+ # name: Build release binaries
78+ # needs: [release-please]
79+ # if: ${{ needs.release-please.outputs.releases-created }}
80+ # uses: ./.github/workflows/build-js.yml
81+ # with:
82+ # os: ubuntu-latest
83+ # ref: ${{ needs.release-please.outputs.tag-name }}
84+
85+ # upload-release:
86+ # name: Upload release binaries
87+ # needs: [release-please, build-release]
88+ # if: ${{ needs.release-please.outputs.releases-created }}
89+ # uses: ./.github/workflows/upload-binaries.yml
90+ # with:
91+ # tag: ${{ needs.release-please.outputs.tag-name }}
92+ # ref: ${{ needs.release-please.outputs.tag-name }}
93+ # secrets:
94+ # UPLOAD_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
96+ # upload-npm-artifacts:
97+ # needs: [release-please]
98+ # if: ${{ needs.release-please.outputs.releases-created }}
99+ # name: Upload release npm artifacts
100+ # runs-on: ubuntu-latest
101+ # outputs:
102+ # stdlib-download-url: ${{ steps.stdlib-upload.outputs.browser_download_url }}
103+ # steps:
104+ # - name: Checkout project
105+ # uses: actions/checkout@v3
106+ # with:
107+ # ref: ${{ needs.release-please.outputs.tag-name }}
108+
109+ # # Many of these steps are the same as building the compiler for tests
110+ # - name: Setup Node.js
111+ 112+ # with:
113+ # node-version: ">=18.15 <19"
114+ # check-latest: true
115+ # cache: "npm"
116+
117+ # - name: Pack stdlib
118+ # working-directory: ./stdlib
119+ # # Runs `npm pack` and assigns the filename to an env var we can use later
120+ # run: |
121+ # echo "STDLIB_TAR=$(npm pack --json | jq -r '.[0].filename')" >> $GITHUB_ENV
122+
123+ # - name: Upload stdlib
124+ # id: stdlib-upload
125+ # uses: grain-lang/[email protected] 126+ # with:
127+ # token: ${{ secrets.GITHUB_TOKEN }}
128+ # file: ./stdlib/${{ env.STDLIB_TAR }}
129+ # asset_name: stdlib.tgz
130+ # tag: ${{ needs.release-please.outputs.stdlib-tag-name }}
131+
132+ # dispatch-website:
133+ # needs: [release-please, upload-release]
134+ # if: ${{ needs.release-please.outputs.releases-created }}
135+ # name: Dispatch website release
136+ # runs-on: ubuntu-latest
137+ # steps:
138+ # - uses: grain-lang/[email protected] 139+ # with:
140+ # workflow: Grain Release
141+ # token: ${{ secrets.WORKFLOW_TOKEN }}
142+ # ref: main
143+ # repo: grain-lang/grain-lang.org
144+ # tag_input: ${{ needs.release-please.outputs.tag-name }}
145+
146+ # dispatch-homebrew:
147+ # needs: [release-please, upload-release]
148+ # if: ${{ needs.release-please.outputs.releases-created }}
149+ # name: Dispatch homebrew release
150+ # runs-on: ubuntu-latest
151+ # steps:
152+ # - uses: grain-lang/[email protected] 153+ # with:
154+ # workflow: Grain Release
155+ # token: ${{ secrets.WORKFLOW_TOKEN }}
156+ # ref: main
157+ # repo: grain-lang/homebrew-tap
158+ # tag_input: ${{ needs.release-please.outputs.tag-name }}
159+
160+ # npm-release-stdlib:
161+ # needs: [release-please, upload-npm-artifacts]
162+ # if: ${{ needs.release-please.outputs.releases-created }}
163+ # name: Publish stdlib to npm registry
164+ # runs-on: ubuntu-latest
165+ # steps:
166+ # - name: Setup NodeJS
167+ 168+ # with:
169+ # node-version: ">=18.15 <19"
170+ # check-latest: true
171+ # registry-url: "https://registry.npmjs.org"
172+
173+ # - name: Publish to npm
174+ # run: |
175+ # npm publish ${{ needs.upload-npm-artifacts.outputs.stdlib-download-url }}
176+ # env:
177+ # NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE }}
0 commit comments