-
Notifications
You must be signed in to change notification settings - Fork 4
36 lines (35 loc) · 1.43 KB
/
github-actions.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
name: test-deploy-gradle-sora-plugin
on: [pull_request, create]
jobs:
test-deploy-plugin:
runs-on: ubuntu-latest
steps:
# Checks-out the repo under $GITHUB_WORKSPACE, so that workflow accesses it
- uses: actions/checkout@e7e449dced768f0201582e76e92398df44e85f4f # v4.1.1
- name: Store gradle key & secret into gradle.properties
env:
GRADLE_KEY: ${{ secrets.GRADLE_KEY }}
GRADLE_SECRET: ${{ secrets.GRADLE_SECRET }}
run: |
mkdir -p ~/.gradle/
echo gradle.publish.key=${GRADLE_KEY} >> ~/.gradle/gradle.properties
echo gradle.publish.secret=${GRADLE_SECRET} >> ~/.gradle/gradle.properties
- name: Check for new tag created # and set TAG_NAME
if: ${{ github.event_name == 'create' && github.event.ref_type == 'tag' }}
run: |
echo "plugin_tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Make scripts executable
run: |
chmod +x gradlew
- name: Run Gradle Wrapper Daemon, Build, then Test
run: |
export TAG_NAME=${{ env.plugin_tag }}
./gradlew --daemon
./gradlew build -x test
./gradlew publishToMavenLocal
./gradlew test
- name: Run Publish # if new tag created
if: ${{ github.event_name == 'create' && github.event.ref_type == 'tag' }}
run: |
export TAG_NAME=${{ env.plugin_tag }}
./gradlew publishPlugins