diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..183b71cc --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,50 @@ +name: Release + +on: + push: + tags: + - 'v*.*.*' + +jobs: + build-and-release: + name: Build and Release + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Set up JDK 8 + uses: actions/setup-java@v5 + with: + java-version: '8' + distribution: 'temurin' + cache: maven + + - name: set version + run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF#refs/*/} | cut -c 2-)" >> $GITHUB_ENV + + - name: Build Linux Version + run: mvn clean package -B -ntp -DskipTests -P Linux-64 + + - name: Build Windows Version + run: mvn package -B -ntp -DskipTests -P Windows-64 + + - name: Build macOS Version + run: mvn package -B -ntp -DskipTests -P Macosx-64 + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b #v.3.0.1 + with: + name: Release ${{ github.ref_name }} + draft: false + prerelease: false + files: | + ${{ github.workspace }}/target/pgsqlblocks-${{ env.RELEASE_VERSION }}-Linux-64.jar + ${{ github.workspace }}/target/pgsqlblocks-${{ env.RELEASE_VERSION }}-Windows-64.jar + ${{ github.workspace }}/target/pgsqlblocks-${{ env.RELEASE_VERSION }}-Macosx-64.jar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file