-
Notifications
You must be signed in to change notification settings - Fork 314
65 lines (62 loc) · 2.48 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
name: Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
tag:
description: "Git tag to release from"
required: true
type: string
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false
jobs:
publish:
env:
ORT_VERSION: ${{ inputs.tag || github.ref_name }}
permissions:
attestations: write
contents: write
id-token: write
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: ${{ env.ORT_VERSION }}
fetch-depth: 0
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4
with:
gradle-home-cache-cleanup: true
- name: Publish to OSSRH
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED: true
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
run: ./gradlew --no-configuration-cache publishAndReleaseToMavenCentral
- name: Build ORT Distributions
env:
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
run: ./gradlew :cli:signDistTar :cli:signDistZip :helper-cli:signDistTar :helper-cli:signDistZip
- name: Generate Release Notes
run: ./gradlew -q printChangeLog > RELEASE_NOTES.md
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create $ORT_VERSION --notes-file RELEASE_NOTES.md \
./cli/build/distributions/ort-$ORT_VERSION.{tgz,zip}* \
./helper-cli/build/distributions/orth-$ORT_VERSION.{tgz,zip}*
- name: Attest Build Provenance
uses: actions/attest-build-provenance@310b0a4a3b0b78ef57ecda988ee04b132db73ef8 # v1
with:
subject-path: |
./cli/build/distributions/ort-${{ env.ORT_VERSION }}.tgz
./cli/build/distributions/ort-${{ env.ORT_VERSION }}.zip
./helper-cli/build/distributions/orth-${{ env.ORT_VERSION }}.tgz
./helper-cli/build/distributions/orth-${{ env.ORT_VERSION }}.zip