-
-
Notifications
You must be signed in to change notification settings - Fork 2
99 lines (87 loc) · 2.94 KB
/
release.yml
File metadata and controls
99 lines (87 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Release
on:
push:
branches:
- main
jobs:
release-please:
name: Create Release
runs-on: ubuntu-22.04
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: google-github-actions/release-please-action@v3.7.10
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: ocaml
package-name: libbinaryen
pull-request-title-pattern: "chore${scope}: Release${component} ${version}"
add-archive:
needs: [release-please]
if: ${{ needs.release-please.outputs.release_created }}
name: Add archive to release
runs-on: macos-latest
outputs:
browser_download_url: ${{ steps.upload.outputs.browser_download_url }}
notes: ${{ steps.upload.outputs.notes }}
steps:
- name: Install git-archive-all
run: |
brew install git-archive-all
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- name: Build archive
run: |
git-archive-all libbinaryen.tar.gz
- name: Upload Release Asset
id: upload
uses: grain-lang/upload-release-action@v3.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
file: ./libbinaryen.tar.gz
asset_name: libbinaryen-${{ needs.release-please.outputs.tag_name }}.tar.gz
tag: ${{ needs.release-please.outputs.tag_name }}
opam-release:
needs: [release-please, add-archive]
name: Publish to opam registry
runs-on: ubuntu-22.04
steps:
- name: Setup bot user
run: |
git config --global user.email "bot@grain-lang.org"
git config --global user.name "Grain Bot"
- name: Generate CHANGES file
env:
CHANGES: ${{ needs.add-archive.outputs.notes }}
run: |
echo -n "$CHANGES" > CHANGES.md
- name: Setup OCaml
uses: ocaml/setup-ocaml@4dd53a587b9836a35604fec9601e606ff42145bc # v3.4.1
with:
ocaml-compiler: 5.2.0
- name: Install publish utils
run: |
opam install opam-publish=3.0.0
- name: Publish to opam
env:
OPAM_PUBLISH_GH_TOKEN: ${{ secrets.OPAM_RELEASE }}
run: |
opam publish --no-confirmation --no-browser --msg-file=CHANGES.md ${{ needs.add-archive.outputs.browser_download_url }}
npm-release:
needs: [add-archive]
name: Publish to npm registry
runs-on: ubuntu-22.04
steps:
- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- name: Publish to npm
run: npm publish ${{ needs.add-archive.outputs.browser_download_url }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE }}