--- trunk/.github/workflows/release.yml 2024/07/29 17:59:26 575 +++ trunk/.github/workflows/release.yml 2024/09/07 14:55:53 629 @@ -4,6 +4,9 @@ branches: - main +permissions: + contents: write + jobs: build: if: github.repository_owner == 'onesoft-sudo' @@ -15,10 +18,10 @@ runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js 21.x - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 21.x @@ -49,14 +52,15 @@ - name: "Package the build output files" run: | OS="${{ matrix.os }}"; - mkdir -p sudobot-release-${OS}/lib; - mv build sudobot; + mkdir sudobot-release-${OS}; + mv build sudobot-release-${OS}; mv src sudobot-release-${OS}; - mv lib/build sudobot-release-${OS}/lib; + mkdir sudobot-release-${OS}/lib; + mv lib/build sudobot-release-${OS}/lib/build; tar -cvzf sudobot-release-${OS}-incomplete.tar.gz sudobot-release-${OS}; - name: Upload Release Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: sudobot-release-${{ matrix.os }}-incomplete path: | @@ -68,7 +72,7 @@ runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Prepare Git run: | @@ -78,26 +82,26 @@ git config --global user.signingkey "6AE7B08C68169452" git config --global commit.gpgsign true - - name: Conventional Changelog Action - id: changelog - uses: TriPSs/conventional-changelog-action@v5 - with: - github-token: ${{ secrets.__TOKEN }} - version-file: "./package.json" - git-user-name: "Conventional Changelog Action" + - name: Conventional Release Action + id: auto_release + uses: onesoft-sudo/conventional-release-action@main + with: + version-json-file: "./package.json" + git-user-name: "Conventional Release Action" git-user-email: rakinar2@onesoftnet.eu.org - git-message: | - release: {version} [skip ci] - - Signed-off-by: Ar Rakin + commit-message-format: "release: v%s [skip ci]" + git-sign-off: true + changelog-file: CHANGELOG.md + changelog-format: markdown + allowed-commit-types: feat,fix,refactor,perf,ci,build,test,revert,chore,release,deps - name: Download Linux Release Artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: sudobot-release-ubuntu-latest-incomplete - name: Download macOS Release Artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: sudobot-release-macos-latest-incomplete @@ -124,12 +128,18 @@ - name: Create Release id: create_release uses: ncipollo/release-action@v1 - if: ${{ steps.changelog.outputs.skipped == 'false' }} + if: ${{ steps.auto_release.outputs.tag != '' }} env: GITHUB_TOKEN: ${{ secrets.__TOKEN }} with: - tag: ${{ steps.changelog.outputs.tag }} - name: ${{ steps.changelog.outputs.tag }} - body: ${{ steps.changelog.outputs.clean_changelog }} + tag: ${{ steps.auto_release.outputs.tag }} + name: ${{ steps.auto_release.outputs.tag }} + body: ${{ steps.auto_release.outputs.release_notes }} artifactContentType: application/x-gzip artifacts: ./sudobot-release-linux.tar.gz,./sudobot-release-darwin.tar.gz + + deploy-staging: + needs: [build, release] + if: github.repository_owner == 'onesoft-sudo' + uses: ./.github/workflows/staging.yml + secrets: inherit