-
Notifications
You must be signed in to change notification settings - Fork 61
117 lines (111 loc) · 3.6 KB
/
release.yml
File metadata and controls
117 lines (111 loc) · 3.6 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Release ruby.wasm
on:
schedule:
- cron: "0 15 * * *"
workflow_dispatch:
inputs:
tag-name:
type: string
description: "Release tag"
required: true
type:
type: choice
description: "Release type"
required: true
options:
- "nightly"
- "stable"
push:
tags: ["*"]
jobs:
create-tag:
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-24.04
permissions:
contents: write
outputs:
tag-name: ${{ steps.generate-tag.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v6
- name: git config
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- id: generate-tag
run: |
MANUAL_TAG="${{ inputs.tag-name }}"
echo "TAG_NAME=${MANUAL_TAG:-$(date +'%Y-%m-%d')-a}" >> $GITHUB_OUTPUT
- uses: ruby/setup-ruby@v1
if: ${{ inputs.type == 'stable' }}
with:
ruby-version: "3.4"
- run: rake 'bump_version[${{ steps.generate-tag.outputs.TAG_NAME }}]'
if: ${{ inputs.type == 'stable' }}
- run: git commit -am "Release ${{ steps.generate-tag.outputs.TAG_NAME }}"
if: ${{ inputs.type == 'stable' }}
- run: git tag "${{ steps.generate-tag.outputs.TAG_NAME }}"
- run: git push origin "${{ steps.generate-tag.outputs.TAG_NAME }}"
- run: git push origin HEAD:main
if: ${{ inputs.type == 'stable' }}
# For nightly releases, we just build and publish npm packages
release-nightly-npm-packages:
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'nightly') }}
needs:
- create-tag
permissions:
contents: write
id-token: write
packages: write
uses: ./.github/workflows/build.yml
with:
publish: true
prerel_name: ${{ needs.create-tag.outputs.tag-name }}
secrets: inherit
# For stable releases, we build and publish npm packages, ruby_wasm gem, and js gem
release-tag-npm-packages:
if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'stable') }}
needs:
- create-tag
permissions:
contents: write
id-token: write
packages: write
uses: ./.github/workflows/build.yml
with:
publish: true
prerel_name: ${{ needs.create-tag.outputs.tag-name || github.ref_name }}
secrets: inherit
release-tag-ruby_wasm-gem:
if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'stable') }}
needs:
- create-tag
permissions:
contents: write
id-token: write
packages: write
uses: ./.github/workflows/build-gems.yml
with:
publish: true
ref: ${{ needs.create-tag.outputs.tag-name || github.ref_name }}
secrets: inherit
release-tag-js-gem:
if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'stable') }}
runs-on: ubuntu-24.04
needs:
- create-tag
permissions:
contents: write
id-token: write
packages: write
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.create-tag.outputs.tag-name || github.ref_name }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
- uses: rubygems/configure-rubygems-credentials@v1.0.0
- run: |
cd packages/gems/js
gem build
gem push js-*.gem