Skip to content

Commit 4cde50a

Browse files
committed
Use GITHUB_TOKEN in GitHub Actions
1 parent 1640232 commit 4cde50a

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
push:
44
tags:
55
- "*"
6+
permissions:
7+
contents: write
68
jobs:
79
test:
810
strategy:
@@ -12,19 +14,19 @@ jobs:
1214
runs-on: ${{ matrix.os }}
1315
steps:
1416
- uses: actions/checkout@v4
15-
17+
1618
- name: Set up JDK 11
1719
uses: actions/setup-java@v4
1820
with:
1921
java-version: '11'
2022
distribution: 'temurin'
21-
23+
2224
- name: Grant execute permission for gradlew
2325
run: chmod +x gradlew
2426
if: matrix.os != 'windows-latest'
25-
27+
2628
- name: Run unit tests
27-
run: ./gradlew ciTest --info
29+
run: ./gradlew ciTest --no-daemon --info
2830
shell: bash
2931

3032
build:
@@ -40,19 +42,18 @@ jobs:
4042
java-version: '8'
4143
distribution: 'temurin'
4244

43-
- name: Setup Git
44-
run: echo ${{ secrets.PAT }} | gh auth login --with-token
45-
4645
- name: Setup Gradle
4746
uses: gradle/gradle-build-action@v3
48-
47+
4948
- name: Grant execute permission for gradlew
5049
run: chmod +x gradlew
5150

5251
- name: Run build with Gradle Wrapper
53-
run: ./gradlew build -x test -Partifact_version=${{ github.ref_name }}
52+
run: ./gradlew build -x test --no-daemon -Partifact_version=${{ github.ref_name }}
5453

5554
- name: Create Release and Upload Jar
5655
run: |
5756
gh release create ${{ github.ref_name }} -t "Release ${{ github.ref_name }}"
5857
gh release upload "${{ github.ref_name }}" build/libs/* --clobber
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)