-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): added github actions to the repository from the example rep…
…ository
- Loading branch information
1 parent
399aca3
commit 493b6bc
Showing
2 changed files
with
190 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
on: | ||
push: | ||
branches: | ||
- release | ||
|
||
jobs: | ||
versioning: | ||
name: "Bump the version of the package according to the conventional commit" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Clone the library repository" | ||
uses: actions/checkout@v3 | ||
- name: "Clone repository for CI workflows" | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: kruegerfelix/ax_ci_workflows | ||
token: ${{ secrets.CI_KIT_TOKEN }} | ||
path: ax_ci_workflows | ||
- name: "Install apax and dependencies" | ||
uses: ./ax_ci_workflows/.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" | ||
file: "conventional-commit" | ||
token: ${{ secrets.CI_KIT_TOKEN }} | ||
- name: "Bump version" | ||
run: | | ||
ls -a | ||
pwd | ||
sudo chmod +x ./conventional-commit | ||
sudo ./conventional-commit \ | ||
--commit-message "${{ github.event.head_commit.message }}" \ | ||
--path . \ | ||
--update \ | ||
build: | ||
name: "Build apax library" | ||
runs-on: ubuntu-latest | ||
needs: versioning | ||
steps: | ||
- name: "Clone the library repository" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Clone repository for CI workflows" | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: kruegerfelix/ax_ci_workflows | ||
token: ${{ secrets.CI_KIT_TOKEN }} | ||
path: ax_ci_workflows | ||
- name: "Install apax and dependencies" | ||
uses: ./ax_ci_workflows/.github/actions/setup-apax-runner | ||
with: | ||
apax-access-token: ${{ secrets.APAX_TOKEN }} | ||
|
||
- name: "Build apax library" | ||
uses: ./ax_ci_workflows/.github/actions/build-apax-package | ||
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 | ||
needs: build | ||
steps: | ||
- name: "Clone the library repository" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Clone repository for CI workflows" | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: kruegerfelix/ax_ci_workflows | ||
token: ${{ secrets.CI_KIT_TOKEN }} | ||
path: ax_ci_workflows | ||
|
||
- name: "Install apax and dependencies" | ||
uses: ./ax_ci_workflows/.github/actions/setup-apax-runner | ||
with: | ||
apax-access-token: ${{ secrets.APAX_TOKEN }} | ||
|
||
- name: "Build apax library" | ||
uses: ./ax_ci_workflows/.github/actions/build-apax-package | ||
with: | ||
library-directory: ${{ github.workspace }} | ||
apax-access-token: ${{ secrets.APAX_TOKEN }} | ||
|
||
- name: "Test apax package" | ||
run: apax test | ||
|
||
release: | ||
name: "Release binary" | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: "Clone the library repository" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Clone repository for CI workflows" | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: kruegerfelix/ax_ci_workflows | ||
token: ${{ secrets.CI_KIT_TOKEN }} | ||
path: ax_ci_workflows | ||
|
||
- name: "Install apax and dependencies" | ||
uses: ./ax_ci_workflows/.github/actions/setup-apax-runner | ||
with: | ||
apax-access-token: ${{ secrets.APAX_TOKEN }} | ||
|
||
- name: "Download artifact" | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: library-artifact | ||
|
||
- name: "Login to the private repo" | ||
run: | | ||
apax login \ | ||
--registry "https://npm.pkg.github.com" \ | ||
--password ${{ secrets.CI_KIT_TOKEN }} | ||
- name: "Pack and publish the library" | ||
run: | | ||
apax pack 2>.package.err 1>.signature | ||
PACKAGE="$(grep -oP '(?<=\").+.apax\.tgz(?=\")' .package.err)" | ||
apax publish --package $PACKAGE --registry https://npm.pkg.github.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: test-apax | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: "Build apax library" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Clone the library repository" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Clone repository for CI workflows" | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: kruegerfelix/ax_ci_workflows | ||
token: ${{ secrets.CI_KIT_TOKEN }} | ||
path: ax_ci_workflows | ||
- name: "Install apax and dependencies" | ||
uses: ./ax_ci_workflows/.github/actions/setup-apax-runner | ||
with: | ||
apax-access-token: ${{ secrets.APAX_TOKEN }} | ||
|
||
- name: "Build apax library" | ||
uses: ./ax_ci_workflows/.github/actions/build-apax-package | ||
with: | ||
library-directory: ${{ github.workspace }} | ||
apax-access-token: ${{ secrets.APAX_TOKEN }} | ||
|
||
test: | ||
name: "Test apax library" | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: "Clone the library repository" | ||
uses: actions/checkout@v3 | ||
|
||
- name: "Clone repository for CI workflows" | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: kruegerfelix/ax_ci_workflows | ||
token: ${{ secrets.CI_KIT_TOKEN }} | ||
path: ax_ci_workflows | ||
|
||
- name: "Install apax and dependencies" | ||
uses: ./ax_ci_workflows/.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 | ||
with: | ||
library-directory: ${{ github.workspace }} | ||
apax-access-token: ${{ secrets.APAX_TOKEN }} |