Skip to content

Commit 13fd59d

Browse files
committed
build(GitHub): Create a GitHub release with distributions attached
The new default "restrictive" permissions [1] require explicit opt-in to `contents: write` in order to create releases. [1]: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 28b6e71 commit 13fd59d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
publish:
1616
env:
1717
ORT_VERSION: ${{ inputs.tag || github.ref_name }}
18+
permissions:
19+
contents: write
1820
runs-on: ubuntu-22.04
1921
steps:
2022
- name: Checkout Repository
@@ -36,3 +38,13 @@ jobs:
3638
with:
3739
gradle-home-cache-cleanup: true
3840
arguments: publishAllPublicationsToOSSRHRepository
41+
- name: Build ORT Distributions
42+
uses: gradle/gradle-build-action@v2
43+
with:
44+
gradle-home-cache-cleanup: true
45+
arguments: :cli:distZip :helper-cli:distZip
46+
- name: Create GitHub Release
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
run: |
50+
gh release create $ORT_VERSION ./cli/build/distributions/ort-$ORT_VERSION.zip ./helper-cli/build/distributions/orth-$ORT_VERSION.zip

0 commit comments

Comments
 (0)