-
Notifications
You must be signed in to change notification settings - Fork 7
76 lines (68 loc) · 2.37 KB
/
package-ffi-sdks.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
name: Package FFI SDKs
on:
workflow_call:
inputs:
engine-tag:
description: "Engine tag to build"
type: string
required: false
sdks:
description: "SDK(s) to build"
type: string
required: true
tag:
description: "Tag to use for SDK(s)"
type: string
required: false
permissions:
contents: write
id-token: write
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
NPM_API_KEY: ${{ secrets.NPM_API_KEY }}
PYPI_API_KEY: ${{ secrets.PYPI_API_KEY }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_PUBLISH_REGISTRY_URL: ${{ secrets.MAVEN_PUBLISH_REGISTRY_URL }}
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
GO_VERSION: "1.23"
DAGGER_VERSION: "0.12.3"
jobs:
build:
runs-on: ubuntu-latest
env:
ENGINE_TAG: ${{ inputs.engine-tag }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: Install Dagger
run: |
cd /usr/local
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=${{ env.DAGGER_VERSION }} sh
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.FLIPT_RELEASE_BOT_APP_ID }}
private_key: ${{ secrets.FLIPT_RELEASE_BOT_APP_PEM }}
installation_id: ${{ secrets.FLIPT_RELEASE_BOT_INSTALLATION_ID }}
- name: Get Pub.Dev OIDC Token
if: ${{ inputs.sdks == 'dart' }}
run: |
OIDC_TOKEN=$(curl -sLS "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=https://pub.dev" -H "User-Agent: actions/oidc-client" -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" | jq -r '.value')
if [ -z "$OIDC_TOKEN" ]; then
echo "Failed to obtain OIDC token"
exit 1
fi
echo "PUB_TOKEN=$OIDC_TOKEN" >> $GITHUB_ENV
- name: Build Individual SDK(s)
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
dagger run go run ./package/ffi --sdks=${{ inputs.sdks }} --push=true --tag=${{ inputs.tag }} --engine-tag=${{ inputs.engine-tag }}