From 6300d5f40c1b1100a51063cf36e0c6131af1703b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Kalici=C5=84ski?= Date: Mon, 2 Dec 2024 19:13:02 +0100 Subject: [PATCH] Workflow experiments --- .github/workflows/release.yml | 105 ++++++++++++++------------ .github/workflows/run-tests.yml | 4 +- .github/workflows/run-validations.yml | 6 +- 3 files changed, 63 insertions(+), 52 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d43b3674..e0a9b16d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,13 +4,16 @@ on: pull_request: branches: [master] types: [closed] + push: + branches: + - 'wkal/js_size_optim' jobs: check-release: name: Check release required - if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true + if: endsWith(github.repository, '-private') != true runs-on: - group: organization/Default + group: macos-gh outputs: release: ${{ steps.check.outputs.ready }} steps: @@ -26,52 +29,60 @@ jobs: uses: ./.github/.release/actions/actions/checks/release with: token: ${{ secrets.GH_TOKEN }} - publish: - name: Publish package - needs: check-release - if: needs.check-release.outputs.release == 'true' - runs-on: - group: organization/Default - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - # This should be the same as the one specified for on.pull_request.branches - ref: master - submodules: recursive - - name: Checkout actions - uses: actions/checkout@v4 - with: - repository: pubnub/client-engineering-deployment-tools - ref: v1 - token: ${{ secrets.GH_TOKEN }} - path: .github/.release/actions - - name: Publish to Maven - uses: ./.github/.release/actions/actions/services/maven - with: - token: ${{ secrets.GH_TOKEN }} - nexus-username: ${{ secrets.NEXUS_USERNAME }} - nexus-password: ${{ secrets.NEXUS_PASSWORD }} - gpg-key-id: ${{ secrets.GPG_KEY_ID }} - gpg-key-name: ${{ secrets.GPG_KEY_NAME }} - gpg-key-passphrase: ${{ secrets.GPG_KEY_PASSPHRASE }} - maven-plugin: "new-gradle-nexus-publish" - prepend-product-to-tag: true - - name: Create Release - uses: ./.github/.release/actions/actions/services/github-release - with: - token: ${{ secrets.GH_TOKEN }} - prepend-product-to-tag: true - last-service: true -# - name: Update Pages -# uses: ./.github/.release/actions/actions/services/github-pages + - id: dev + name: dev + run: find . | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/" + - id: dev2 + name: dev2 + run: env +# publish: +# name: Publish package +# needs: check-release +# if: needs.check-release.outputs.release == 'true' +# runs-on: +# group: macos-gh +# steps: +# - name: Find which product is being released +# uses: actions/github-script@v6 +# id: check-env +# with: +# result-encoding: string +# script: | +# try { +# const fs = require('fs') +# const jsonString = fs.readFileSync('./dir/file.json') +# var apps = JSON.parse(jsonString) +# } catch(err) { +# core.error("Error while reading or parsing the JSON") +# core.setFailed(err) +# } +# - name: Checkout repository +# uses: actions/checkout@v4 +# with: +# # This should be the same as the one specified for on.pull_request.branches +# ref: master +# submodules: recursive +# - name: Checkout actions +# uses: actions/checkout@v4 +# with: +# repository: pubnub/client-engineering-deployment-tools +# ref: v1 +# token: ${{ secrets.GH_TOKEN }} +# path: .github/.release/actions +# - name: Publish to Maven +# uses: ./.github/.release/actions/actions/services/maven # with: # token: ${{ secrets.GH_TOKEN }} -# source-folder: build/dokka/gfmMultiModule -# jira-api-key: ${{ secrets.JIRA_API_KEY }} -# last-service: true -# - name: Upload test reports -# uses: ./.github/.release/actions/actions/test-reports/upload +# nexus-username: ${{ secrets.NEXUS_USERNAME }} +# nexus-password: ${{ secrets.NEXUS_PASSWORD }} +# gpg-key-id: ${{ secrets.GPG_KEY_ID }} +# gpg-key-name: ${{ secrets.GPG_KEY_NAME }} +# gpg-key-passphrase: ${{ secrets.GPG_KEY_PASSPHRASE }} +# maven-plugin: "new-gradle-nexus-publish" +# prepend-product-to-tag: true +# - name: Create Release +# uses: ./.github/.release/actions/actions/services/github-release # with: # token: ${{ secrets.GH_TOKEN }} -# acceptance-tests-workflow: Tests +# prepend-product-to-tag: true +# last-service: true \ No newline at end of file diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index efdbee03..7c500be7 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -8,7 +8,7 @@ jobs: tests: name: Integration and Unit tests runs-on: - group: organization/Default + group: macos-gh steps: - name: Checkout repository uses: actions/checkout@v4 @@ -51,7 +51,7 @@ jobs: name: Tests needs: [tests] runs-on: - group: organization/Default + group: macos-gh steps: - name: Tests summary run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed" diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml index fb829673..7bc319be 100644 --- a/.github/workflows/run-validations.yml +++ b/.github/workflows/run-validations.yml @@ -14,7 +14,7 @@ jobs: pubnub-yml: name: "Validate .pubnub.yml" runs-on: - group: organization/Default + group: macos-gh steps: - name: Checkout project uses: actions/checkout@v4 @@ -37,7 +37,7 @@ jobs: build-validation: name: Validate build runs-on: - group: organization/Default + group: macos-gh steps: - name: Checkout repository uses: actions/checkout@v4 @@ -66,7 +66,7 @@ jobs: name: Validations needs: [pubnub-yml, build-validation] runs-on: - group: organization/Default + group: macos-gh steps: - name: Validations summary run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed"