Skip to content

Commit f9a0071

Browse files
committed
build: add official release job without the actual release script call
1 parent 3832d90 commit f9a0071

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,51 @@ jobs:
109109
result-encoding: string
110110
- name: Release
111111
run: yarn release run snapshot --skip-prompts --skip-auth-check --use-auth-token --allow-custom ${{ inputs.dry_run && '--dry-run' || ''}} ${{ steps.prepare_workspaces_arg.outputs.result }}
112+
release_official:
113+
name: Create an official release
114+
runs-on: ubuntu-latest
115+
if: ${{ inputs.type == 'official' }}
116+
needs: [ lint_and_unit_tests, cypress_tests ]
117+
steps:
118+
- uses: actions/checkout@v4
119+
with:
120+
ref: ${{ inputs.release_ref }}
121+
# This is needed for yarn version to work properly, but it increases fetch time.
122+
# We can change this back to "1" if we replace yarn version with something else
123+
fetch-depth: 0
124+
- name: Verify release commit is tagged
125+
run: |
126+
if ! git tag --points-at ${{ inputs.release_ref }}; then
127+
echo '::error:: Release ref does not point to any tag. Please tag the merge commit of the release PR and try again'
128+
exit 1
129+
else
130+
echo 'Release commit verified'
131+
fi
132+
- name: Configure git
133+
run: |
134+
git config --global user.name 'EUI Machine'
135+
git config --global user.email '[email protected]'
136+
- uses: actions/setup-node@v6
137+
with:
138+
node-version-file: .nvmrc
139+
cache: yarn
140+
registry-url: 'https://registry.npmjs.org'
141+
- name: Install dependencies
142+
run: npm install -g npm@latest && yarn install --immutable
143+
- name: Build release scripts
144+
run: yarn workspace @elastic/eui-release-cli run build
145+
- name: Rename git remote to upstream
146+
run: git remote rename origin upstream
147+
- name: Prepare list of workspaces
148+
id: prepare_workspaces_arg
149+
uses: actions/github-script@v8
150+
env:
151+
WORKSPACES: ${{ inputs.workspaces }}
152+
with:
153+
# language=javascript
154+
script: |
155+
if (!process.env.WORKSPACES || typeof process.env.WORKSPACES !== 'string') {
156+
return '';
157+
}
158+
return `--workspaces ${process.env.WORKSPACES.split(',').join(' ')}`;
159+
result-encoding: string

0 commit comments

Comments
 (0)