-
Notifications
You must be signed in to change notification settings - Fork 11
87 lines (86 loc) · 3.19 KB
/
release.yml
File metadata and controls
87 lines (86 loc) · 3.19 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
on:
workflow_dispatch:
inputs:
releaseVersion:
description: Next release version
required: true
type: string
changeLog:
description: Pending changelog
required: true
type: string
jobs:
release:
runs-on: ubuntu-latest
env:
LD_RELEASE_VERSION: ${{ inputs.releaseVersion }}
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
RUBYGEM_API_KEY: ${{ secrets.RUBYGEM_API_KEY }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CENTRAL_PORTAL_USERNAME: ${{ secrets.CENTRAL_PORTAL_USERNAME }}
CENTRAL_PORTAL_PASSWORD: ${{ secrets.CENTRAL_PORTAL_PASSWORD }}
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt -q install -y unzip jq nodejs npm python3 python3-pip ruby
# Install Go
curl -s https://dl.google.com/go/go1.15.5.linux-amd64.tar.gz | sudo tar -xz -C /usr/local
# Install yarn
npm install --global yarn
# Install python deps
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
pip install bravado
pip install twine
pip install -U packaging
# Set up ruby
mkdir -p ~/.rubygems
- uses: actions/setup-java@v1
with:
java-version: '11'
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.1.0
name: Get secrets
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
s3_path_pairs: 'launchdarkly-releaser/java/code-signing-keyring.gpg = /home/runner/code-signing-keyring.gpg'
- name: Prepare secrets
run: |
./scripts/release/prepare.sh
- name: Build clients
run: |
export PATH=/opt/gradle/bin:/usr/local/go/bin:$HOME/.rubygems/bin:$PATH
export GEM_HOME=$HOME/.rubygems
java -XX:+PrintFlagsFinal -version | grep ThreadStackSize
make
# Verify that the generated client code can be built
make BUILD_TARGETS="go java python ruby typescript-axios" build_clients
# This step will:
# * Push built clients to their respective Github repos
# * Tag those commits with the release version
# * Publish each client to it's respective platform (e.g. Rubygems)
- name: Publish clients
run: |
export PATH=/opt/gradle/bin:/usr/local/go/bin:$HOME/.rubygems/bin:$PATH
export GEM_HOME=$HOME/.rubygems
./scripts/release/publish.sh
# This step creates a release with changelog from the tag
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
needs: release
strategy:
matrix:
repo: ['api-client-go', 'api-client-java', 'api-client-python', 'api-client-ruby', 'api-client-typescript']
steps:
- uses: ncipollo/release-action@v1.14.0
with:
repo: ${{ matrix.repo }}
token: ${{ secrets.BOT_TOKEN }}
tag: v${{ inputs.releaseVersion }}
body: ${{ inputs.changeLog }}