From 5d9cece992bf3d3100f65da0f6922fd911187500 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 5 May 2021 13:35:13 +0200 Subject: ci: Add workflow for releases This change adds a new Github Actions workflow that is triggered when a new tag is pushed. This workflow will automatically build the project and create a new Github release. --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..59dc346a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + push: + tags: ['v*'] + +jobs: + build: + name: Build OpenDC + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 15 ] + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - uses: actions/cache@v1 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.java }}-gradle- + - name: Build with Gradle + run: ./gradlew :assembleDist + - name: Release + uses: softprops/action-gh-release@v1 + with: + prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-m') }} + files: build/distributions/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -- cgit v1.2.3