diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 00000000..2fed2c2c --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,73 @@ +name: Build release +on: + push: + tags: + - '*' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}-release + cancel-in-progress: true + +permissions: + contents: write + +jobs: + export_to_designer: + name: Export to designer xml + uses: ./.github/workflows/step-export-xml.yml + with: + edt_version: 2023.1.2 + artifact_name: designer-src + engine_only: true + secrets: inherit + + build_artifacts: + runs-on: ubuntu-latest + needs: export_to_designer + + steps: + - name: install 8.3.21.1895 + uses: alkoleft/onec-setup-build-env-action@develop + with: + type: onec + onec_version: 8.3.21.1895 + cache: true + env: + ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }} + ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }} + timeout-minutes: 10 + + - name: download artifact + uses: actions/download-artifact@v4 + with: + name: designer-src + - name: extract artifacts + run: | + mkdir export + cd export + 7z x ../export.7z -y + + - name: create IB + run: ibcmd infobase create --db-path=file-db + timeout-minutes: 5 + + - name: import yaxunit + run: ibcmd infobase config import --db-path=file-db --extension=YAXUNIT export/yaxunit + timeout-minutes: 5 + + - name: save yaxunit + run: ibcmd infobase config save --db-path=file-db --extension=YAXUNIT YAxUnit-${{ needs.export_to_designer.outputs.yaxunit_version }}.cfe + timeout-minutes: 5 + + - name: Release + uses: softprops/action-gh-release@v2 + if: ${{ success() }} + with: + draft: true + files: YAxUnit-*.cfe + fail_on_unmatched_files: true + generate_release_notes: true + append_body: false + name: Версия ${{ needs.export_to_designer.outputs.yaxunit_version }} + token: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/deploy-documentation.yml b/.github/workflows/deploy-documentation.yml index 8c07ce64..8e6e0cd4 100644 --- a/.github/workflows/deploy-documentation.yml +++ b/.github/workflows/deploy-documentation.yml @@ -16,7 +16,7 @@ jobs: name: Deploy to GitHub Pages runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download bsl doc run: curl -L https://github.com/alkoleft/bsldoc/releases/download/0.1.0/bsldoc-0.1.0.jar --output ./bsldoc.jar && chmod +7 ./bsldoc.jar - name: Generate API documentation diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index 6c5ac56e..68f74f3e 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -4,13 +4,12 @@ on: branches: - feature/** - develop - tags: - - '*' + pull_request_target: branches: [ develop ] concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}-main cancel-in-progress: true permissions: @@ -66,9 +65,3 @@ jobs: v8_version: ${{ matrix.v8_version }} locale: ${{ matrix.locale }} secrets: inherit - - publish_artifacts: - name: Publish draft release - if: ${{ startsWith(github.ref, 'refs/tags/') && success() }} - uses: ./.github/workflows/step-publish-artifacts.yml - needs: build_artifacts diff --git a/.github/workflows/sq-pr.yml b/.github/workflows/sq-pr.yml index 0f8f3bb2..ced5177f 100644 --- a/.github/workflows/sq-pr.yml +++ b/.github/workflows/sq-pr.yml @@ -1,13 +1,13 @@ name: Анализ в SonarQube (pull-request) -on: [pull_request] +on: [pull_request_target] jobs: SonarScanner: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{ github.event.workflow_run.head_repository.full_name }} ref: ${{ github.event.workflow_run.head_branch }} diff --git a/.github/workflows/sq.yml b/.github/workflows/sq.yml index 42654d91..56769139 100644 --- a/.github/workflows/sq.yml +++ b/.github/workflows/sq.yml @@ -10,7 +10,7 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.event.repository.full_name steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{ github.event.workflow_run.head_repository.full_name }} ref: ${{ github.event.workflow_run.head_branch }} diff --git a/.github/workflows/step-build-artifacts-windows.yml b/.github/workflows/step-build-artifacts-windows.yml index ccbc259a..07fbe7f1 100644 --- a/.github/workflows/step-build-artifacts-windows.yml +++ b/.github/workflows/step-build-artifacts-windows.yml @@ -40,7 +40,7 @@ jobs: timeout-minutes: 10 - name: download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ inputs.src_artifact_name }} @@ -75,7 +75,7 @@ jobs: timeout-minutes: 5 - name: upload-artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ inputs.artifact_name }} path: binary\*.* diff --git a/.github/workflows/step-export-xml.yml b/.github/workflows/step-export-xml.yml index 5bb73dad..91b4055a 100644 --- a/.github/workflows/step-export-xml.yml +++ b/.github/workflows/step-export-xml.yml @@ -9,6 +9,14 @@ on: artifact_name: type: string required: true + + engine_only: + type: boolean + required: false + default: false + outputs: + yaxunit_version: + value: ${{ jobs.export.outputs.yaxunit_version }} concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}-export @@ -17,9 +25,17 @@ concurrency: jobs: export: runs-on: ubuntu-latest + outputs: + yaxunit_version: ${{ steps.extract_version.outputs.version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Extract version + if: github.event_name == 'push' + shell: bash + run: echo "version=$(cat ./exts/yaxunit/src/Configuration/Configuration.mdo | grep -oP '(?<=)[\d.]+')" >> $GITHUB_OUTPUT + id: extract_version + - name: install EDT uses: alkoleft/onec-setup-build-env-action@develop with: @@ -29,9 +45,10 @@ jobs: env: ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }} ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }} - timeout-minutes: 10 + timeout-minutes: 30 - name: convert configuration src + if: ${{ !inputs.engine_only }} uses: alkoleft/onec-edtcli-command-action@main with: export: true @@ -50,6 +67,7 @@ jobs: timeout-minutes: 10 - name: convert tests src + if: ${{ !inputs.engine_only }} uses: alkoleft/onec-edtcli-command-action@main with: export: true @@ -63,7 +81,7 @@ jobs: 7za a -t7z ../export.7z ./ - name: upload-artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ inputs.artifact_name }} path: export.7z diff --git a/.github/workflows/step-publish-artifacts.yml b/.github/workflows/step-publish-artifacts.yml index b36204a0..23eb6bf2 100644 --- a/.github/workflows/step-publish-artifacts.yml +++ b/.github/workflows/step-publish-artifacts.yml @@ -21,7 +21,7 @@ jobs: steps: - name: download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ inputs.artifact_name }} path: binary diff --git a/.github/workflows/step-run-tests-linux.yml b/.github/workflows/step-run-tests-linux.yml index 28a2840b..4731a925 100644 --- a/.github/workflows/step-run-tests-linux.yml +++ b/.github/workflows/step-run-tests-linux.yml @@ -38,7 +38,7 @@ jobs: steps: - name: download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ inputs.artifact_name }} path: binary @@ -157,14 +157,14 @@ jobs: run: cat ./output.log - name: upload-artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: Tests report. Linux ${{ inputs.v8_version }} ${{ inputs.locale }} path: reports/*.* - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 + uses: 1CDevFlow/action-onec-junit-report@main if: always() with: job_name: Tests Linux ${{ inputs.v8_version }} ${{ inputs.locale }} diff --git a/.github/workflows/step-run-tests-windows.yml b/.github/workflows/step-run-tests-windows.yml index f98bda05..ab48216b 100644 --- a/.github/workflows/step-run-tests-windows.yml +++ b/.github/workflows/step-run-tests-windows.yml @@ -37,7 +37,7 @@ jobs: steps: - name: download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ inputs.artifact_name }} path: binary @@ -89,11 +89,11 @@ jobs: } } - - uses: bhowell2/github-substring-action@1.0.2 + - name: set short_locale id: short_locale - with: - value: ${{ inputs.locale }} - length_from_start: 2 + run: | + Write-Output "substring='${{ inputs.locale }}'.Substring(0, 2)" >> $Env:GITHUB_OUTPUT + - name: Test run: | Start-Process ibsrv.exe -ArgumentList "--data=data" @@ -109,13 +109,13 @@ jobs: run: type 1cv8c-output.log - name: upload-artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Tests report. Windows ${{ inputs.v8_version }} ${{ inputs.locale }} path: reports/ - name: Publish Test Report - uses: mikepenz/action-junit-report@v3 + uses: 1CDevFlow/action-onec-junit-report@main with: job_name: Tests Windows ${{ inputs.v8_version }} ${{ inputs.locale }} check_name: Tests report. Windows ${{ inputs.v8_version }} ${{ inputs.locale }} diff --git a/.github/workflows/step-run-tests.yml b/.github/workflows/step-run-tests.yml deleted file mode 100644 index c97f63fe..00000000 --- a/.github/workflows/step-run-tests.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Run tests on Linux - -on: - workflow_call: - inputs: - - matrix: - description: 'Matrix parameters' - type: string - required: true - - artifact_name: - type: string - required: false - default: build-artifacts - - fail_on_failure: - type: boolean - required: false - default: true - -permissions: - contents: read - checks: write - id-token: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }} - cancel-in-progress: true - -jobs: - tests_windows: - uses: ./.github/workflows/step-run-tests-windows.yml - with: - matrix: ${{ inputs.matrix }} - secrets: inherit - - tests_ubuntu: - uses: ./.github/workflows/step-run-tests-linux.yml - with: - matrix: ${{ inputs.matrix }} - secrets: inherit \ No newline at end of file