diff --git a/.github/workflows/01-parsec-integration.yml b/.github/workflows/01-parsec-integration.yml index ed7e09fc6..b2028930c 100644 --- a/.github/workflows/01-parsec-integration.yml +++ b/.github/workflows/01-parsec-integration.yml @@ -12,6 +12,9 @@ on: build_matrix_community: description: build tasks value: ${{ jobs.parsec_integration.outputs.build_matrix_community }} + build_matrix_commercial: + description: build tasks + value: ${{ jobs.parsec_integration.outputs.build_matrix_commercial }} all_build_task: description: all build tasks used for value: ${{ jobs.parsec_integration.outputs.all_build_task }} @@ -48,6 +51,7 @@ jobs: build_matrix_main: ${{ steps.parsec_integration.outputs.build_matrix_main }} build_matrix_dde: ${{ steps.parsec_integration.outputs.build_matrix_dde }} build_matrix_community: ${{ steps.parsec_integration.outputs.build_matrix_community }} + build_matrix_commercial: ${{ steps.parsec_integration.outputs.build_matrix_commercial }} all_build_task: ${{ steps.parsec_integration.outputs.all_build_task }} testrepoaddr: ${{ steps.parsec_integration.outputs.testrepoaddr }} deploy: ${{ steps.illegal_repo_tags.outputs.DEPLOY }} @@ -72,6 +76,7 @@ jobs: GITHUB_TOKEN: ${{ github.token }} PR_TITLE: ${{ github.event.pull_request.title }} PR_AUTHOR: ${{ github.event.pull_request.user.login }} + COMMERCIALS: ${{ vars.COMMERCIALS }} run: | import requests import yaml @@ -172,7 +177,10 @@ jobs: def get_component(repo): print("get component") + commercials = os.environ.get("COMMERCIALS") + commercial_list = commercials.split(",") component = "main" + package = repo[repo.find('/')+1:] if "linuxdeepin/" in repo: component = "dde" else: @@ -184,10 +192,13 @@ jobs: else: print("Warn: get workflows.yml content failed!!!") component = "community" + + if package in commercial_list: + component = "commercial" return component try: - components = ["main", "dde", "community"] + components = ["main", "dde", "community", "commercial"] allBuildTasks = [{"component": j,"data":{"payload": []}} for j in components] data = read_integration() @@ -211,6 +222,8 @@ jobs: component_index = 1 if component == "community": component_index = 2 + if component == "commercial": + component_index = 3 print("component: %s" % component) tagsha = repo.get('tagsha', "") tag = repo.get('tag', "") diff --git a/.github/workflows/02-build-obs.yml b/.github/workflows/02-build-obs.yml index ceb74b9a5..1adffae57 100644 --- a/.github/workflows/02-build-obs.yml +++ b/.github/workflows/02-build-obs.yml @@ -16,6 +16,8 @@ on: component: type: string default: "main" + gitaddr: + type: string workflow_dispatch: inputs: repo: @@ -40,6 +42,7 @@ env: TAGSHA: ${{ inputs.tagsha }} GITHUB_TOKEN: ${{ github.token }} OSCPASS: ${{ secrets.OSCPASS }} + GITADDR: ${{ inputs.gitaddr }} jobs: build: @@ -80,6 +83,10 @@ jobs: curl -o meta1.xml https://raw.githubusercontent.com/deepin-community/Repository-Integration/master/.github/workflows/obs-proj-component-meta.tpl sed -i "s#TOPIC#${TOPIC}#g" meta1.xml sed -i "s#COMPONENT#${COMPONENT}#g" meta1.xml + if [ "$COMPONENT" = "commercial" ]; then + echo "commercail project, disable access!!!" + sed -i '4a \ \ \n\ \ \ \ \n\ \ \n\ \ \n\ \ \ \ \n\ \ ' meta1.xml + fi curl -X PUT -u golf66:$OSCPASS -H "Content-type: text/xml" -d @meta1.xml "https://build.deepin.com/source/deepin:CI:TestingIntegration:$TOPIC:$COMPONENT/_meta" fi fi @@ -157,6 +164,14 @@ jobs: if [ ! -f _service ];then curl -o _service https://raw.githubusercontent.com/deepin-community/Repository-Integration/master/.github/workflows/obs-pkg.tpl && \ sed -i "s#REPO#$REPO#g" _service + if [ "$COMPONENT" = "commercial" ]; then + echo "commercial package, need use private git ssh address!!!" + new_content=" ${GITADDR}" + sed -i "3c ${new_content}" _service + echo "commercial package, disable build source!!!" + echo "exec dpkg-buildpackage -us -uc --build=any,all \"\$@\"" > build.script + curl -X PUT -u golf66:$OSCPASS -d @build.script -s "$uploadurl/build.script" + fi curl -X PUT -u golf66:$OSCPASS -d @_service -s "$uploadurl/_service" fi if [ $needbuild = "true" ];then diff --git a/.github/workflows/auto-integration.yml b/.github/workflows/auto-integration.yml index 05be2fc2c..42fd37630 100644 --- a/.github/workflows/auto-integration.yml +++ b/.github/workflows/auto-integration.yml @@ -94,12 +94,14 @@ jobs: - build_main - build_dde - build_community + - build_commercial if: | always() && !cancelled() && (needs.parsec_integration.result == 'success') && (needs.ouput_message.result != 'failure' ) && (needs.build_main.result == 'success' || needs.build_main.result == 'skipped') && (needs.build_dde.result == 'success' || needs.build_dde.result == 'skipped') && - (needs.build_community.result == 'success' || needs.build_community.result == 'skipped') + (needs.build_community.result == 'success' || needs.build_community.result == 'skipped') && + (needs.build_commercial.result == 'success' || needs.build_commercial.result == 'skipped') steps: - name: wait build pending status uses: actions/github-script@v6 @@ -172,6 +174,7 @@ jobs: - build_main - build_dde - build_community + - build_commercial - wait_build_pending_status if: | always() && !cancelled() && @@ -179,6 +182,7 @@ jobs: (needs.build_main.result == 'success' || needs.build_main.result == 'skipped') && (needs.build_dde.result == 'success' || needs.build_dde.result == 'skipped') && (needs.build_community.result == 'success' || needs.build_community.result == 'skipped') && + (needs.build_commercial.result == 'success' || needs.build_commercial.result == 'skipped') && needs.wait_build_pending_status.result == 'success' uses: deepin-community/Repository-Integration/.github/workflows/issue-project-manager.yml@master secrets: inherit @@ -279,3 +283,22 @@ jobs: tagsha: ${{ matrix.payload.tagsha }} topic: test-integration-pr-${{ github.event.number }} component: "community" + + build_commercial: + name: build_commercial + if: always() && !cancelled() && (needs.parsec_integration.outputs.build_matrix_commercial != '') && (needs.parsec_integration.result == 'success') + needs: + - parsec_integration + - build_project_prepare + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_commercial) }} + uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master + secrets: inherit + with: + repo: ${{ matrix.payload.repo }} + tag: ${{ matrix.payload.tag }} + tagsha: ${{ matrix.payload.tagsha }} + topic: test-integration-pr-${{ github.event.number }} + component: "commercial" + gitaddr: ${{ matrix.payload.gitaddr }}