diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28f3a4f..c4a7201 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,4 +37,6 @@ jobs: windows-build: needs: check-workflows - uses: ./.github/workflows/windows-build.yml \ No newline at end of file + uses: ./.github/workflows/windows-build.yml + with: + upload-artifacts: false diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..ca69bde --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,45 @@ +name: Create a Release + +on: + push: + tags: + - v*.*.* + +jobs: + check-workflows: + uses: ./.github/workflows/check-workflows.yml + + build-artifacts: + needs: check-workflows + uses: ./.github/workflows/windows-build.yml + with: + upload-artifacts: true + + create-release: + needs: build-artifacts + runs-on: ubuntu-latest + permissions: + contents: write + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + + - name: Create a Release + run: gh release create ${{ github.ref }} -F ReleaseNote.md + + - name: Download ocesql.exe + uses: actions/download-artifact@v4 + with: + name: ocesql.exe + + - name: Download ocesql4j.jar + uses: actions/download-artifact@v4 + with: + name: ocesql4j.jar + + - name: Publish artifacts + run: | + gh release upload ${{ github.ref_name }} ocesql.exe --clobber + gh release upload ${{ github.ref_name }} ocesql4j.jar --clobber diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 39ad70a..55b09cf 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -2,6 +2,11 @@ name: Windows build on: workflow_call: + inputs: + upload-artifacts: + description: 'Upload artifacts' + required: true + type: boolean permissions: contents: read @@ -94,4 +99,18 @@ jobs: run: | fc /b .\sample-result ..\win\sample-correct > test-result findstr "no differences encountered" test-result - shell: cmd \ No newline at end of file + shell: cmd + + - name: Upload ocesql.exe + if: ${{ inputs.upload-artifacts }} + uses: actions/upload-artifact@v4 + with: + name: ocesql.exe + path: win\x64\Release\ocesql.exe + + - name: Upload ocesql.exe + if: ${{ inputs.upload-artifacts }} + uses: actions/upload-artifact@v4 + with: + name: ocesql4j.jar + path: dblibj\target\scala-2.13\ocesql4j.jar diff --git a/ReleaseNote.md b/ReleaseNote.md new file mode 100644 index 0000000..04b83ff --- /dev/null +++ b/ReleaseNote.md @@ -0,0 +1 @@ +This is a sample release \ No newline at end of file