summaryrefslogtreecommitdiff
path: root/.github/workflows/release.yml
blob: b83b8a367a849beecf2d506f41f15e354cea6766 (plain)
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
name: release

on: [ push ]

jobs:
  release:
    runs-on: ubuntu-latest
    if: github.ref != 'refs/heads/master'
    steps:
      - name: Checkout code
        uses: actions/checkout@v3
      - name: Set up JDK
        uses: actions/setup-java@v3
        with:
          java-version: '17'
          distribution: 'adopt'
      - name: Validate Gradle wrapper
        uses: gradle/wrapper-validation-action@v1
      - name: Setup Gradle
        uses: gradle/gradle-build-action@v2
      - name: Make gradlew executable
        run: chmod +x gradlew
      - name: Gradle build
        run: ./gradlew build
      - name: Print directory tree
        run: find .
      - name: Gradle test
        run: ./gradlew test
      - name: Get version string
        run: export VERSION=$(echo ${{ github.ref }} | sed 's/-.\+//')
      - name: Upload binaries to release
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file_glob: true
          file: build/libs/kbackup-fabric*
          tag: 1.7.1
          release_name: ${{ env.VERSION }}
          prerelease: true