diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-05-05 13:35:13 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-05-05 13:49:49 +0200 |
| commit | 5d9cece992bf3d3100f65da0f6922fd911187500 (patch) | |
| tree | 37c55e286d39640ddc548b84ba7a9d470ef99e04 /.github | |
| parent | e1d892bcbaa7e8361c150f684ca6a0dc5e036a87 (diff) | |
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.
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/release.yml | 39 |
1 files changed, 39 insertions, 0 deletions
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 }} |
