-
Notifications
You must be signed in to change notification settings - Fork 7
64 lines (55 loc) · 2.15 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: a stable version to set in version.txt before publishing (e.g. 0.42.1, without the 'v' prefix)
jobs:
release:
name: Build & Release
permissions:
contents: write
id-token: write
environment: Public Release
runs-on: "ubuntu-latest"
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSPHRASE }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Semgrep
run: python3 -m pip install semgrep
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- uses: gradle/gradle-build-action@v2
env:
ORG_GRADLE_PROJECT_codemodderOpenAIKey: ${{ secrets.CODEMODDER_OPENAI_API_KEY }}
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
arguments: --console=plain --quiet --no-configuration-cache -Pversion=${{ inputs.version }} build distZip publishNebulaPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ inputs.version }}
release_name: v${{ inputs.version }}
draft: false
prerelease: false
- name: Upload Core Codemods Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core-codemods/build/distributions/core-codemods-${{ inputs.version }}.zip
asset_name: codemodder-java-codemods-${{ inputs.version }}.zip
asset_content_type: application/zip