Merge pull request #19 from y-ok/fix/load-data-txmanager-multidb-0.2.4 #23
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Release tag to publish (for example: 0.1.5)" | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| packages: write | |
| actions: read | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 120 | |
| env: | |
| DOCKER_HOST: unix:///var/run/docker.sock | |
| TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: /var/run/docker.sock | |
| TESTCONTAINERS_RYUK_DISABLED: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }} | |
| fetch-depth: 0 | |
| - name: Resolve release context | |
| id: context | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| if ! git rev-parse "refs/tags/${{ inputs.tag }}" >/dev/null 2>&1; then | |
| echo "::error::GATE_TAG_NOT_FOUND: tag '${{ inputs.tag }}' not found." | |
| exit 17 | |
| fi | |
| echo "tag_name=${{ inputs.tag }}" >> "${GITHUB_OUTPUT}" | |
| echo "target_sha=$(git rev-list -n 1 "refs/tags/${{ inputs.tag }}")" >> "${GITHUB_OUTPUT}" | |
| else | |
| echo "tag_name=${{ github.ref_name }}" >> "${GITHUB_OUTPUT}" | |
| echo "target_sha=$(git rev-list -n 1 "${GITHUB_REF}")" >> "${GITHUB_OUTPUT}" | |
| fi | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: "11" | |
| cache: maven | |
| server-id: github | |
| server-username: GITHUB_ACTOR | |
| server-password: GITHUB_TOKEN | |
| - name: Build and deploy Maven packages | |
| run: mvn -B clean deploy -Dmaven.test.skip=true -pl flexdblink,flexdblink-maven-plugin | |
| env: | |
| GITHUB_ACTOR: ${{ github.actor }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create or update GitHub Release and upload assets | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG_NAME: ${{ steps.context.outputs.tag_name }} | |
| run: | | |
| set -euo pipefail | |
| shopt -s nullglob | |
| assets=( | |
| flexdblink/target/FlexDBLink*.jar | |
| flexdblink/target/FlexDBLink*.zip | |
| flexdblink/target/flexdblink-*.jar | |
| flexdblink/target/flexdblink-*.zip | |
| ) | |
| if [ "${#assets[@]}" -eq 0 ]; then | |
| echo "::error::No release assets found." | |
| exit 18 | |
| fi | |
| if gh release view "${TAG_NAME}" >/dev/null 2>&1; then | |
| gh release upload "${TAG_NAME}" "${assets[@]}" --clobber | |
| else | |
| gh release create "${TAG_NAME}" "${assets[@]}" --title "${TAG_NAME}" --generate-notes | |
| fi |