aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/release.yml
blob: 3bef8b3302cb9f6efed6d8ba6463b3370189e8db (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Release Workflow

name: Release

on:
  workflow_dispatch:
  push:
    branches:
      - master

concurrency:
  group: ${{ github.head_ref || format('{0}-{1}', github.ref, github.run_number) }}
  cancel-in-progress: true

jobs:
  build:
    name: Build

    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Set up JDK 17
        uses: actions/setup-java@v2
        with:
          java-version: 17
          distribution: temurin

      - uses: actions/cache@v2
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
            **/loom-cache
            **/prebundled-jars
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
          restore-keys: |
            ${{ runner.os }}-gradle-

      - name: Chmod Gradle
        run: chmod +x ./gradlew

      - name: Get version number
        run: echo '::set-output name=VERSION_NUMBER::$(( ${{ secrets.BUILD_OFFSET }} + ${{ github.run_number }}))'
        id: version

      - name: Publish
        run: ./gradlew platform:publishAllPublicationsToReleasesRepository -Pmod_minor_version=${{ steps.version.outputs.VERSION_NUMBER }} -PreleasesUsername=${{ secrets.MAVEN_NAME }} -PreleasesPassword=${{ secrets.MAVEN_TOKEN }} --no-daemon

      - name: Upload Build Artifacts
        uses: actions/upload-artifact@v2
        with:
          name: oneconfig-artifacts
          path: versions/**/build/libs/