Skip to content

Commit

Permalink
feat(ci): added github actions to the repository from the example rep…
Browse files Browse the repository at this point in the history
…ository
  • Loading branch information
kruegerfelix committed Jun 24, 2022
1 parent 399aca3 commit 493b6bc
Show file tree
Hide file tree
Showing 2 changed files with 190 additions and 0 deletions.
135 changes: 135 additions & 0 deletions .github/workflows/github-action-release.yml
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
55 changes: 55 additions & 0 deletions .github/workflows/github-action-test-apax.yml
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 }}

0 comments on commit 493b6bc

Please sign in to comment.