diff --git a/.github/workflows/github-action-release_for_template.yml b/.github/workflows/github-action-release_for_template.yml deleted file mode 100644 index 3e3cef3..0000000 --- a/.github/workflows/github-action-release_for_template.yml +++ /dev/null @@ -1,102 +0,0 @@ -name: release-package -on: - push: - branches: - - release - -env: - PROJECT_NAME: template-library - 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" - 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: ${{ env.ACTIONS_REPO }} - token: ${{ secrets.CI_KIT_TOKEN }} - 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: simatic-ax/actions/setup-apax-runner@stable - with: - apax-access-token: ${{ secrets.APAX_TOKEN }} - - - name: "Get latest simatic-versioning executable" - uses: dsaltares/fetch-gh-release-asset@master - with: - repo: ${{ env.VERSIONING_TOOL_REPO }} - file: "conventional-commit" - token: ${{ secrets.CI_KIT_TOKEN }} - - - id: bump - name: "Bump version" - run: | - apax version ${{ env.VERSION }} - sudo chmod +x ./conventional-commit - ./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 - release: - name: "Release binary" - 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: simatic-ax/actions - token: ${{ secrets.CI_KIT_TOKEN }} - path: ./actions - - - name: "Install apax and dependencies" - uses: simatic-ax/actions/setup-apax-runner@stable - 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: "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 \ No newline at end of file diff --git a/.github/workflows/release-template.yml b/.github/workflows/release-template.yml new file mode 100644 index 0000000..9378f55 --- /dev/null +++ b/.github/workflows/release-template.yml @@ -0,0 +1,15 @@ +on: + push: + # Pattern matched against refs/tags + tags: + - "*" + +jobs: + release-apax-lib: + uses: simatic-ax/actions/.github/workflows/apax-publish-template.yml@stable + secrets: + APAX_TOKEN: ${{ secrets.APAX_TOKEN }} + DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} + + with: + VERSION: ${{ github.ref_name }} \ No newline at end of file