mirror of
https://github.com/Snowflake-Labs/dlsync.git
synced 2025-12-18 00:51:27 +00:00
47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
name: release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up JDK 11
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '11'
|
|
distribution: 'temurin'
|
|
- name: Set variables
|
|
run: |
|
|
export VERSION=$(grep "^releaseVersion=" gradle.properties | awk -F"=" '{ print $2 }')
|
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
- name: Setup Gradle
|
|
uses: gradle/gradle-build-action@v2
|
|
- name: Build with Gradle
|
|
run: ./gradlew clean build
|
|
- name: setup git config
|
|
run: |
|
|
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
|
|
git config user.name "GitHub Actions Bot"
|
|
git config user.email "<>"
|
|
- name: Create tag
|
|
run: |
|
|
git tag -a v${{ env.VERSION }} -m "version ${{ env.VERSION }}"
|
|
git push origin v${{ env.VERSION }}
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: v${{ env.VERSION }}
|
|
name: Release v${{ env.VERSION }}
|
|
generate_release_notes: true
|
|
files: |
|
|
build/libs/dlsync-${{ env.VERSION }}.jar
|
|
draft: true
|
|
prerelease: false
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|