-
-
Notifications
You must be signed in to change notification settings - Fork 136
136 lines (133 loc) · 4.69 KB
/
release.yml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Release
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v2.1.3
jobs:
build:
if: github.repository_owner == 'asciidoctor'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
# libgbm-dev is required by Puppeteer 3+
- name: Install system dependencies
run: |
sudo apt-get install -y libgbm-dev
- name: Install dependencies
run: |
npm ci
npm ci --prefix packages/core
- name: Lint, build and test
env:
ASCIIDOCTOR_CORE_VERSION: v2.0.20
run: |
npm run lint
npm run test
npm run travis --prefix packages/core
publish:
if: github.repository_owner == 'asciidoctor'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
# libgbm-dev is required by Puppeteer 3+
- name: Install system dependencies
run: |
sudo apt-get install -y libgbm-dev
# install dependencies
- name: Install dependencies
run: |
npm ci
npm ci --prefix packages/core
# package and publish
- name: Package
env:
ASCIIDOCTOR_CORE_VERSION: v2.0.20
run: ./scripts/package.sh
- name: Publish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: ./scripts/publish.sh
- name: Make sure that @asciidoctor/core has been published on npmjs
run: |
timeout 60s ./scripts/wait-asciidoctor-core-published.sh
- name: Produce binaries
run: ./scripts/binaries.sh
# create the GitHub release
- name: Create release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
# upload assets
- name: Upload source code as a zip file
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: packages/core/bin/asciidoctor.js.dist.zip
asset_name: asciidoctor.js.dist.zip
asset_content_type: application/zip
- name: Upload source code as a tar.gz file
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: packages/core/bin/asciidoctor.js.dist.tar.gz
asset_name: asciidoctor.js.dist.tar.gz
asset_content_type: application/tar+gzip
- name: Upload Linux binary
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: packages/asciidoctor/dist/asciidoctor-linux
asset_name: asciidoctor-linux
asset_content_type: application/octet-stream
- name: Upload macOS binary
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: packages/asciidoctor/dist/asciidoctor-macos
asset_name: asciidoctor-macos
asset_content_type: application/octet-stream
- name: Upload Windows binary
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: packages/asciidoctor/dist/asciidoctor-win.exe
asset_name: asciidoctor-win.exe
asset_content_type: application/octet-stream
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Announcement
uses: zulip/github-actions-zulip/send-message@v1
with:
email: ${{ secrets.ZULIP_USERNAME }}
api-key: ${{ secrets.ZULIP_API_KEY }}
organization-url: 'https://asciidoctor.zulipchat.com'
to: '279652'
type: 'stream'
topic: 'releases'
content: |
Asciidoctor.js ${{ env.RELEASE_VERSION }} is out!
https://github.com/asciidoctor/asciidoctor.js/releases/tag/${{ env.RELEASE_VERSION }}