From 4c7b1abf1d4c6a7e2e72bc922f253512536a9298 Mon Sep 17 00:00:00 2001 From: "Drosdzoll, Thomas (DI FA CTR EE PO2)" Date: Mon, 28 Apr 2025 14:47:18 +0200 Subject: [PATCH 1/3] Incorporate new actions and workflows --- .github/workflows/build-library.yml | 10 -- .github/workflows/lint-repo.yml | 4 - .../package-development-workflow.yml | 87 +++++++++++++++ .../workflows/package-release-workflow.yml | 105 ++++++++++++++++++ .github/workflows/release-library.yml | 16 --- .markdownlint.yml | 14 --- repolinter.json | 22 ---- 7 files changed, 192 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/build-library.yml delete mode 100644 .github/workflows/lint-repo.yml create mode 100644 .github/workflows/package-development-workflow.yml create mode 100644 .github/workflows/package-release-workflow.yml delete mode 100644 .github/workflows/release-library.yml delete mode 100644 .markdownlint.yml delete mode 100644 repolinter.json diff --git a/.github/workflows/build-library.yml b/.github/workflows/build-library.yml deleted file mode 100644 index 51fa2e2..0000000 --- a/.github/workflows/build-library.yml +++ /dev/null @@ -1,10 +0,0 @@ -on: push - -jobs: - test-apax-lib: - uses: simatic-ax/actions/.github/workflows/apax-build-test.yml@stable - secrets: - APAX_TOKEN: ${{ secrets.APAX_TOKEN }} - SIMATIC_AX_TOKEN: ${{ secrets.DEPLOY_KEY }} - with: - LOGIN_SIMATIC_AX: true \ No newline at end of file diff --git a/.github/workflows/lint-repo.yml b/.github/workflows/lint-repo.yml deleted file mode 100644 index 9863aa7..0000000 --- a/.github/workflows/lint-repo.yml +++ /dev/null @@ -1,4 +0,0 @@ -on: push -jobs: - lint-repo-and-markdown: - uses: simatic-ax/actions/.github/workflows/check-repository.yml@stable diff --git a/.github/workflows/package-development-workflow.yml b/.github/workflows/package-development-workflow.yml new file mode 100644 index 0000000..7abf900 --- /dev/null +++ b/.github/workflows/package-development-workflow.yml @@ -0,0 +1,87 @@ +# This workflow is going to be used during the development phase of the project +# The workflow builds and tests the the sources on the following triggers: +# - once a change is pushed to the main branch or any of its sub-branches +name: Library development workflow + +on: + push: + branches: + - 'main' # runs the workflow, once new changes have been integrated to main + - 'main/**' # runs the workflow, once new changes have been integrated to a sub-branch of main + pull_request: + branches: + - 'main' # run workflow in the scope of pull requests towards main + workflow_call: + secrets: + APAX_TOKEN: + required: true + inputs: + ref: + required: true + type: string + +permissions: + contents: read # required for checkout + packages: read # required for pulling the container + actions: write # required for artifact uploading + +jobs: + build-and-test: + name: Build and Test + runs-on: ubuntu-24.04 + container: + image: ghcr.io/simatic-ax/ci-images/apax-ci-image:3.4.2 + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + # either check out a provided reference, or use the reference that triggered this workflow, e.g. a push, PR or a release + ref: ${{ inputs.ref != '' && inputs.ref || github.ref }} + + - name: Login to required registries + uses: simatic-ax/actions/apax-login@v3 + with: + apax-token: ${{ secrets.APAX_TOKEN }} + registries: | + https://npm.pkg.github.com/,${{ secrets.GITHUB_TOKEN }} + + - name: Install dependencies + uses: simatic-ax/actions/apax-install@v3 + with: + immutable: true + + - name: Build source code + uses: simatic-ax/actions/apax-build@v3 + with: + apax-build-targets: | + llvm + 1500 + apax-build-args: | + --debug + --log Debug + + - name: Test source code + uses: simatic-ax/actions/apax-test@v3 + with: + coverage: true + loglevel: debug + + - name: Check links + uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + check-modified-files-only: 'yes' + base-branch: 'main' + + - name: Upload build artifacts + if: ${{ github.event_name == 'workflow_call' || github.event_name == 'release'}} + uses: actions/upload-artifact@v4 + with: + name: build-artifacts + path: | + bin/1500 + bin/llvm + retention-days: 90 + if-no-files-found: error \ No newline at end of file diff --git a/.github/workflows/package-release-workflow.yml b/.github/workflows/package-release-workflow.yml new file mode 100644 index 0000000..40f6f31 --- /dev/null +++ b/.github/workflows/package-release-workflow.yml @@ -0,0 +1,105 @@ +# This workflow is triggered when a release is published via the UI +# The workflow is only executed if the release is a tag and the target_commitish is a release branch +name: Release workflow + +# Start the workflow as soon as a release has been published via the UI +on: + release: + types: [published] + +permissions: + contents: write # required for checkout + packages: write # required for pulling the container + actions: write # required for artifact downloading + pull-requests: write # Für PR-Erstellung und Management + +jobs: + call-development: + name: Build the package + uses: ./.github/workflows/package-development-workflow.yml + secrets: + APAX_TOKEN: ${{ secrets.APAX_TOKEN }} + with: + # checks out the branch that has been selected during the release process + ref: ${{ github.event.release.target_commitish }} + + release: + name: Release the package + needs: call-development + runs-on: ubuntu-24.04 + container: + image: ghcr.io/simatic-ax/ci-images/apax-ci-image:3.4.2 + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.target_commitish }} + fetch-depth: 0 + + - name: Create bin folder + run: mkdir -p bin + + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-artifacts + path: bin + + - name: Version package + uses: simatic-ax/actions/apax-version@v3 + with: + version: ${{ github.event.release.tag_name }} + + - name: Package source code + uses: simatic-ax/actions/apax-pack@v3 + with: + key: ${{ secrets.APAX_SIGNKEY }} + + - name: Login to required registries + uses: simatic-ax/actions/apax-login@v3 + with: + apax-token: ${{ secrets.APAX_TOKEN }} + registries: | + https://npm.pkg.github.com/,${{ secrets.GITHUB_TOKEN }} + + - name: Publish apax package + uses: simatic-ax/actions/apax-publish@v3 + with: + registries: | + https://npm.pkg.github.com + + # [Optional]: The following steps are not mandatory and are highly depending on your release workflow + # - name: Update Changelog and Create PR + # env: + # GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }} # Hier das neue PAT + # RELEASE_BODY: ${{ github.event.release.body }} + # RELEASE_TAG: ${{ github.event.release.tag_name }} + # RELEASE_DATE: ${{ github.event.release.published_at }} + # TARGET_BRANCH: ${{ github.event.release.target_commitish }} + # run: | + # chmod +x .github/workflows/update-changelog-pr.sh + # .github/workflows/update-changelog-pr.sh + + - name: Update major version tag + if: ${{ success() }} + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + VERSION=${{ github.event.release.tag_name }} + if echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then + MAJOR_VERSION="v$(echo $VERSION | cut -d. -f1)" + echo "Updating major version tag: $MAJOR_VERSION" + git push origin :refs/tags/$MAJOR_VERSION || true + git tag -f $MAJOR_VERSION + git push origin $MAJOR_VERSION --force + echo "✅ Major version tag updated successfully" + else + echo "❌ Error: Invalid version format: '$VERSION'" + echo "Expected format: X.Y.Z (e.g., 1.2.3)" + exit 1 + fi \ No newline at end of file diff --git a/.github/workflows/release-library.yml b/.github/workflows/release-library.yml deleted file mode 100644 index af6befe..0000000 --- a/.github/workflows/release-library.yml +++ /dev/null @@ -1,16 +0,0 @@ -on: - push: - # Pattern matched against refs/tags - tags: - - '*' - -jobs: - release-apax-lib: - uses: simatic-ax/actions/.github/workflows/apax-publish.yml@stable - secrets: - APAX_TOKEN: ${{ secrets.APAX_TOKEN }} - DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} - APAX_SIGNKEY: ${{ secrets.APAX_SIGNKEY }} - - with: - VERSION: ${{ github.ref_name }} diff --git a/.markdownlint.yml b/.markdownlint.yml deleted file mode 100644 index 62620c9..0000000 --- a/.markdownlint.yml +++ /dev/null @@ -1,14 +0,0 @@ -# markdownlint YAML configuration ---- - -# Default state for all rules -default: true - -# ignored rules -line-length: false -no-inline-html: false -first-line-h1: false -no-emphasis-as-header: false -MD024: - allow_different_nesting: true - siblings_only: true \ No newline at end of file diff --git a/repolinter.json b/repolinter.json deleted file mode 100644 index e5384e2..0000000 --- a/repolinter.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/todogroup/repolinter/master/rulesets/schema.json", - "version": 2, - "axioms": { - "linguist": "language", - "licensee": "license", - "packagers": "packager" - }, - "rules": { - "license-file-exists": { - "level": "off", - "rule": { - "type": "file-existence", - "options": { - "globsAny": ["LICENSE*", "COPYING*"], - "nocase": true - } - } - } - } - } - \ No newline at end of file From 02ec62b096e5ad468b1b74516149e119c806d0b5 Mon Sep 17 00:00:00 2001 From: "Drosdzoll, Thomas (DI FA CTR EE PO2)" Date: Mon, 28 Apr 2025 14:51:34 +0200 Subject: [PATCH 2/3] remove single codeowner --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index f60c3d2..846c2f2 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,4 +1,4 @@ # These owners will be the default owners for everything in the repo. # Unless a later match takes precedence, the listed user will be # requested for review when someone opens a pull request. -* @thkindler @jgsiemens \ No newline at end of file +* @thkindler \ No newline at end of file From 0fedfd0b8fa581d15c10b09a9bb13cf83384767b Mon Sep 17 00:00:00 2001 From: "Drosdzoll, Thomas (DI FA CTR EE PO2)" Date: Mon, 28 Apr 2025 15:55:57 +0200 Subject: [PATCH 3/3] cleanup release workflow --- .../workflows/package-release-workflow.yml | 35 +------------------ 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/.github/workflows/package-release-workflow.yml b/.github/workflows/package-release-workflow.yml index 40f6f31..d009a34 100644 --- a/.github/workflows/package-release-workflow.yml +++ b/.github/workflows/package-release-workflow.yml @@ -69,37 +69,4 @@ jobs: uses: simatic-ax/actions/apax-publish@v3 with: registries: | - https://npm.pkg.github.com - - # [Optional]: The following steps are not mandatory and are highly depending on your release workflow - # - name: Update Changelog and Create PR - # env: - # GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }} # Hier das neue PAT - # RELEASE_BODY: ${{ github.event.release.body }} - # RELEASE_TAG: ${{ github.event.release.tag_name }} - # RELEASE_DATE: ${{ github.event.release.published_at }} - # TARGET_BRANCH: ${{ github.event.release.target_commitish }} - # run: | - # chmod +x .github/workflows/update-changelog-pr.sh - # .github/workflows/update-changelog-pr.sh - - - name: Update major version tag - if: ${{ success() }} - run: | - git config --global --add safe.directory "$GITHUB_WORKSPACE" - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - - VERSION=${{ github.event.release.tag_name }} - if echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then - MAJOR_VERSION="v$(echo $VERSION | cut -d. -f1)" - echo "Updating major version tag: $MAJOR_VERSION" - git push origin :refs/tags/$MAJOR_VERSION || true - git tag -f $MAJOR_VERSION - git push origin $MAJOR_VERSION --force - echo "✅ Major version tag updated successfully" - else - echo "❌ Error: Invalid version format: '$VERSION'" - echo "Expected format: X.Y.Z (e.g., 1.2.3)" - exit 1 - fi \ No newline at end of file + https://npm.pkg.github.com \ No newline at end of file