-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (60 loc) · 1.87 KB
/
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
name: Release
on:
push:
branches: [main]
pull_request:
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
pkgs: ${{ steps.filter.outputs.changes }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
inngest: inngest/VERSION
publish:
needs: changes
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
pkg: ${{ fromJSON(needs.changes.outputs.pkgs) }}
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: "8"
distribution: "temurin"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Publish package
working-directory: ${{ matrix.pkg }}
run: gradle publish --info
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_KEY_PASSWORD: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
- name: Create bundle for Maven Central
working-directory: ${{ matrix.pkg }}
run: ./maven-bundle
- name: Upload bundle to Maven Central
working-directory: ${{ matrix.pkg }}
run: |
# Generate bearer token
TOKEN=$(echo -n $AUTH | base64)
PKG_NAME=$NAME:$(cat VERSION)
# Upload via API
curl -v -X POST "$PUBLISHER_API?name=$PKG_NAME" \
-H "Authorization: Bearer $TOKEN" \
-F '[email protected]'
env:
AUTH: "${{ secrets.MAVEN_USERNAME }}:${{ secrets.MAVEN_PASSWORD }}"
NAME: com.inngest:inngest
PUBLISHER_API: https://central.sonatype.com/api/v1/publisher/upload