name: Releases on: push: branches: - main permissions: contents: write deployments: write jobs: build: if: github.repository_owner == 'onesoft-sudo' && github.ref == 'refs/heads/main' strategy: matrix: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Use Node.js 21.x uses: actions/setup-node@v4 with: node-version: 21.x - name: Install Programs, Libraries and Tools (Linux) run: | sudo apt update; sudo apt install build-essential libcurl4 libcurl4-gnutls-dev -y; if: matrix.os == 'ubuntu-latest' - name: Install Programs, Libraries and Tools (macOS) run: brew install curl pkg-config cairo pango libpng jpeg giflib librsvg if: matrix.os == 'macos-latest' - name: "Install Native Libraries" run: | git clone https://github.com/Cogmasters/concord; cd concord; make; sudo make install; cd ..; - name: "Build Native Libraries with GNU Make" run: make - name: "Build with BlazeBuild" run: ./blazew build - name: "Package the build output files" run: | OS="${{ matrix.os }}"; mkdir sudobot-release-${OS}; mv build sudobot-release-${OS}; mv src sudobot-release-${OS}; 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@v4 with: name: sudobot-release-${{ matrix.os }}-incomplete path: | ./sudobot-release-${{ matrix.os }}-incomplete.tar.gz release: needs: [build] if: github.repository_owner == 'onesoft-sudo' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Prepare Git run: | echo "${{ secrets.COMMIT_GPG_KEY }}" > private.key gpg --import private.key rm -f private.key git config --global user.signingkey "6AE7B08C68169452" git config --global commit.gpgsign true - 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 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@v4 with: name: sudobot-release-ubuntu-latest-incomplete - name: Download macOS Release Artifact uses: actions/download-artifact@v4 with: name: sudobot-release-macos-latest-incomplete - name: Extract Artifacts run: | tar -xvzf sudobot-release-ubuntu-latest-incomplete.tar.gz; tar -xvzf sudobot-release-macos-latest-incomplete.tar.gz; - name: Rename Artifacts run: | mv sudobot-release-ubuntu-latest sudobot-release-linux; mv sudobot-release-macos-latest sudobot-release-darwin; - name: Add package.json to Incomplete Artifacts run: | cp package.json sudobot-release-linux/package.json; cp package.json sudobot-release-darwin/package.json; - name: Re-package Artifacts run: | tar -cvzf sudobot-release-linux.tar.gz sudobot-release-linux; tar -cvzf sudobot-release-darwin.tar.gz sudobot-release-darwin; - name: Create Release id: create_release uses: ncipollo/release-action@v1 if: ${{ steps.auto_release.outputs.tag != '' }} env: GITHUB_TOKEN: ${{ secrets.__TOKEN }} with: 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