Skip to content

Commit

Permalink
Merge pull request #19 from simatic-ax/main
Browse files Browse the repository at this point in the history
feat(sdk)!: switch to SDK V2
  • Loading branch information
sjuergen authored Jul 23, 2022
2 parents a8f8647 + d49971c commit 501141c
Show file tree
Hide file tree
Showing 22 changed files with 725 additions and 117 deletions.
95 changes: 66 additions & 29 deletions .github/workflows/github-action-release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
name: release-package
on:
push:
branches:
- release

env:
PROJECT_NAME: json
SCOPE: simatic-ax
ACTIONS_REPO: simatic-ax/actions
ACTIONS_LOCAL: ./actions
VERSIONING_TOOL_REPO: simatic-ax/simatic_versioning

jobs:
versioning:
name: "Bump the version of the package according to the conventional commit"
Expand All @@ -13,29 +21,44 @@ jobs:
- name: "Clone repository for CI workflows"
uses: actions/checkout@v3
with:
repository: kruegerfelix/ax_ci_workflows
repository: ${{ env.ACTIONS_REPO }}
token: ${{ secrets.CI_KIT_TOKEN }}
path: ax_ci_workflows
path: ./actions
- name: "Get the latest version of the package"
run: |
echo "@simatic-ax:registry=https://npm.pkg.github.com/" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.CI_KIT_TOKEN }}" >> .npmrc
echo "always-auth = true" >> .npmrc
cat .npmrc
echo "VERSION=$(npm show @${{ env.SCOPE }}/${{ env.PROJECT_NAME }} version --registry=https://npm.pkg.github.com --scope=${{ env.SCOPE }})" >> $GITHUB_ENV
echo $VERSION
- name: "Check contents of actions folder"
run: tree -d ./actions
- name: "Install apax and dependencies"
uses: ./ax_ci_workflows/.github/actions/setup-apax-runner
uses: ./actions/.github/actions/setup-apax-runner
with:
apax-access-token: ${{ secrets.APAX_TOKEN }}

- name: "Get latest simatic-versioning executable"
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "simatic-ax/simatic_versioning"
repo: ${{ env.VERSIONING_TOOL_REPO }}
file: "conventional-commit"
token: ${{ secrets.CI_KIT_TOKEN }}
- name: "Bump version"

- id: bump
name: "Bump version"
run: |
ls -a
pwd
apax version ${{ env.VERSION }}
sudo chmod +x ./conventional-commit
sudo ./conventional-commit \
--commit-message "${{ github.event.head_commit.message }}" \
--path . \
--update \
./conventional-commit -c "${{ github.event.head_commit.message }}" -v "${{ env.VERSION }}" >> .version
cat .version
- name: "Upload version"
uses: actions/upload-artifact@v3
with:
name: version
path: .version

build:
name: "Build apax library"
Expand All @@ -48,18 +71,23 @@ jobs:
- name: "Clone repository for CI workflows"
uses: actions/checkout@v3
with:
repository: kruegerfelix/ax_ci_workflows
repository: ${{ env.ACTIONS_REPO }}
token: ${{ secrets.CI_KIT_TOKEN }}
path: ax_ci_workflows
path: ./actions

- name: "Install apax and dependencies"
uses: ./ax_ci_workflows/.github/actions/setup-apax-runner
uses: ./actions/.github/actions/setup-apax-runner
with:
apax-access-token: ${{ secrets.APAX_TOKEN }}
- name: "Login to github registry"

- name: "Login to the private repo"
run: |
apax login --registry "https://npm.pkg.github.com" --password ${{ secrets.CI_KIT_TOKEN }}
apax login \
--registry "https://npm.pkg.github.com" \
--password ${{ secrets.CI_KIT_TOKEN }}
- name: "Build apax library"
uses: ./ax_ci_workflows/.github/actions/build-apax-package
uses: ./actions/.github/actions/apax-build
with:
library-directory: ${{ github.workspace }}
apax-access-token: ${{ secrets.APAX_TOKEN }}
Expand All @@ -81,19 +109,23 @@ jobs:
- name: "Clone repository for CI workflows"
uses: actions/checkout@v3
with:
repository: kruegerfelix/ax_ci_workflows
repository: simatic-ax/actions
token: ${{ secrets.CI_KIT_TOKEN }}
path: ax_ci_workflows
path: ./actions

- name: "Install apax and dependencies"
uses: ./ax_ci_workflows/.github/actions/setup-apax-runner
uses: ./actions/.github/actions/setup-apax-runner
with:
apax-access-token: ${{ secrets.APAX_TOKEN }}
- name: "Login to github registry"

- name: "Login to the private repo"
run: |
apax login --registry "https://npm.pkg.github.com" --password ${{ secrets.CI_KIT_TOKEN }}
apax login \
--registry "https://npm.pkg.github.com" \
--password ${{ secrets.CI_KIT_TOKEN }}
- name: "Build apax library"
uses: ./ax_ci_workflows/.github/actions/build-apax-package
uses: ./actions/.github/actions/apax-test
with:
library-directory: ${{ github.workspace }}
apax-access-token: ${{ secrets.APAX_TOKEN }}
Expand All @@ -112,17 +144,15 @@ jobs:
- name: "Clone repository for CI workflows"
uses: actions/checkout@v3
with:
repository: kruegerfelix/ax_ci_workflows
repository: simatic-ax/actions
token: ${{ secrets.CI_KIT_TOKEN }}
path: ax_ci_workflows
path: ./actions

- name: "Install apax and dependencies"
uses: ./ax_ci_workflows/.github/actions/setup-apax-runner
uses: ./actions/.github/actions/setup-apax-runner
with:
apax-access-token: ${{ secrets.APAX_TOKEN }}
- name: "Login to github registry"
run: |
apax login --registry "https://npm.pkg.github.com" --password ${{ secrets.CI_KIT_TOKEN }}

- name: "Download artifact"
uses: actions/download-artifact@v3
with:
Expand All @@ -134,8 +164,15 @@ jobs:
--registry "https://npm.pkg.github.com" \
--password ${{ secrets.CI_KIT_TOKEN }}
- name: "Download artifact"
uses: actions/download-artifact@v3
with:
name: version

- name: "Pack and publish the library"
run: |
cat .version
apax version "$(cat .version)"
apax pack 2>.package.err 1>.signature
PACKAGE="$(grep -oP '(?<=\").+.apax\.tgz(?=\")' .package.err)"
apax publish --package $PACKAGE --registry https://npm.pkg.github.com
49 changes: 36 additions & 13 deletions .github/workflows/github-action-test-apax.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: test-apax
on:
push:
branches:
- '*'
- '!release'
env:
ACTIONS_REPO: simatic-ax/actions
VERSIONING_TOOL_REPO: simatic-ax/simatic_versioning

jobs:
build:
Expand All @@ -14,22 +20,35 @@ jobs:
- name: "Clone repository for CI workflows"
uses: actions/checkout@v3
with:
repository: kruegerfelix/ax_ci_workflows
repository: ${{ env.ACTIONS_REPO }}
token: ${{ secrets.CI_KIT_TOKEN }}
path: ax_ci_workflows
path: actions

- name: "Check contents of actions folder"
run: tree -d ./actions
- name: "Install apax and dependencies"
uses: ./ax_ci_workflows/.github/actions/setup-apax-runner
uses: ./actions/.github/actions/setup-apax-runner
with:
apax-access-token: ${{ secrets.APAX_TOKEN }}
- name: "Login to github registry"

- name: "Login to the private repo"
run: |
apax login --registry "https://npm.pkg.github.com" --password ${{ secrets.CI_KIT_TOKEN }}
apax login \
--registry "https://npm.pkg.github.com" \
--password ${{ secrets.CI_KIT_TOKEN }}
- name: "Build apax library"
uses: ./ax_ci_workflows/.github/actions/build-apax-package
uses: ./actions/.github/actions/apax-build
with:
library-directory: ${{ github.workspace }}
apax-access-token: ${{ secrets.APAX_TOKEN }}

- name: "Upload artifact"
uses: actions/upload-artifact@v3
with:
name: library-artifact
path: bin/

test:
name: "Test apax library"
runs-on: ubuntu-latest
Expand All @@ -41,17 +60,21 @@ jobs:
- name: "Clone repository for CI workflows"
uses: actions/checkout@v3
with:
repository: kruegerfelix/ax_ci_workflows
repository: ${{ env.ACTIONS_REPO }}
token: ${{ secrets.CI_KIT_TOKEN }}
path: ax_ci_workflows

path: actions
- name: "Install apax and dependencies"
uses: ./ax_ci_workflows/.github/actions/setup-apax-runner
uses: ./actions/.github/actions/setup-apax-runner
with:
apax-access-token: ${{ secrets.APAX_TOKEN }}

- name: "Build apax library"
uses: ./ax_ci_workflows/.github/actions/test-apax-package
- name: "Login to the private repo"
run: |
apax login \
--registry "https://npm.pkg.github.com" \
--password ${{ secrets.CI_KIT_TOKEN }}
- name: "Install workspace dependencies and test"
uses: ./actions/.github/actions/apax-test
with:
library-directory: ${{ github.workspace }}
apax-access-token: ${{ secrets.APAX_TOKEN }}
Loading

0 comments on commit 501141c

Please sign in to comment.