Skip to content

Commit

Permalink
Merge pull request #358 from bia-technologies/feature/build-release-job
Browse files Browse the repository at this point in the history
Задание для генерации черновика релиза
  • Loading branch information
alkoleft authored May 21, 2024
2 parents 36f71d7 + 612625e commit e039bff
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 71 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -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 }}

2 changes: 1 addition & 1 deletion .github/workflows/deploy-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/sq-pr.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/step-build-artifacts-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down Expand Up @@ -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\*.*
Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/step-export-xml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 '(?<=<version>)[\d.]+')" >> $GITHUB_OUTPUT
id: extract_version

- name: install EDT
uses: alkoleft/onec-setup-build-env-action@develop
with:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/step-publish-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/step-run-tests-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/step-run-tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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 }}
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/step-run-tests.yml

This file was deleted.

0 comments on commit e039bff

Please sign in to comment.