diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 20d1d8c7..20e8abb0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,12 +6,6 @@ on: # Trigger the workflow on any pull request pull_request: workflow_dispatch: - inputs: - lsp_branch: - required: true - description: "lsp_branch" - default: "main" - type: string jobs: build: @@ -36,6 +30,20 @@ jobs: fetch-depth: 0 ref: ${{ github.event.pull_request.head.ref }} + - name: "setup vars" + id: setupvars + run: | + echo "lsp_version=$(cat refact_lsp)" >> $GITHUB_OUTPUT + + - uses: convictional/trigger-workflow-and-wait@v1.6.1 + name: "Build refact-lsp" + with: + owner: smallcloudai + repo: refact-lsp + workflow_file_name: build.yml + github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + ref: ${{ steps.setupvars.outputs.lsp_version }} + - name: Download artifact id: download-artifact uses: dawidd6/action-download-artifact@v2 @@ -43,7 +51,7 @@ jobs: github_token: ${{secrets.GITHUB_TOKEN}} workflow: build.yml repo: smallcloudai/refact-lsp - branch: ${{ github.event.inputs.lsp_branch }} + branch: ${{ steps.setupvars.outputs.lsp_version }} path: ./src/main/resources/bin # Validate wrapper diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5753ad80..1ae2d1d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,6 +39,7 @@ jobs: - name: Set env CHANNEL shell: bash + id: setupvars run: | raw=$(git branch -r --contains ${{ github.ref }}) GIT_BRANCH=${raw##*/} @@ -50,6 +51,16 @@ jobs: echo "PUBLISH_EAP=1" >> "$GITHUB_ENV" fi echo "GIT_BRANCH=${GIT_BRANCH}" >> "$GITHUB_ENV" + echo "lsp_version=$(cat refact_lsp)" >> $GITHUB_OUTPUT + + - uses: convictional/trigger-workflow-and-wait@v1.6.1 + name: "Build refact-lsp" + with: + owner: smallcloudai + repo: refact-lsp + workflow_file_name: build.yml + github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + ref: ${{ steps.setupvars.outputs.lsp_version }} - name: Download artifact id: download-artifact @@ -58,7 +69,7 @@ jobs: github_token: ${{secrets.GITHUB_TOKEN}} workflow: build.yml repo: smallcloudai/refact-lsp - branch: ${{ github.event.inputs.lsp_branch }} + branch: ${{ steps.setupvars.outputs.lsp_version }} path: ./src/main/resources/bin # Validate wrapper diff --git a/refact_lsp b/refact_lsp new file mode 100644 index 00000000..95e94cdd --- /dev/null +++ b/refact_lsp @@ -0,0 +1 @@ +v0.0.1 \ No newline at end of file