-
Notifications
You must be signed in to change notification settings - Fork 34
74 lines (61 loc) · 1.88 KB
/
create_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
name: 📦 Create a WBS Release
on:
workflow_dispatch:
inputs:
project_name:
description: 'Project to release'
type: choice
required: true
default: 'wikibase'
options:
- deploy
- elasticsearch
- quickstatements
- wdqs
- wdqs-frontend
- wdqs-proxy
- wikibase
- All projects with unreleased changes
dry_run:
description: "Dry run, don't do it yet."
type: boolean
required: true
default: true
permissions:
contents: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
token: ${{ secrets.GH_WBS_BOT_TOKEN }}
- uses: ./.github/actions/setup-environment
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
run: |
set -e # abort on error
set -x # show commands
git config --global user.name 'wikibase-suite-bot'
git config --global user.email '[email protected]'
if [ "${{ inputs.dry_run }}" == "true" ]; then
DRY_RUN_FLAG="--dry-run"
else
DRY_RUN_FLAG=""
fi
if [ "${{ inputs.project_name }}" == "All projects (images and deploy) with unreleased changes" ]; then
PROJECT_ARG=""
else
PROJECT_ARG="-p ${{ inputs.project_name }}"
fi
./nx release $PROJECT_ARG $DRY_RUN_FLAG --skip-publish --verbose
BRANCH="${{ github.ref }}"
echo "Target branch is $BRANCH"
# Temporary workaround for nx issue: https://github.com/nrwl/nx/issues/22073#
if [ $? -eq 0 ] && [ -z "$DRY_RUN_FLAG" ]; then
git push origin $BRANCH --tags
fi