From af0acb90db25bfc3fc17150fecc342bab36c0276 Mon Sep 17 00:00:00 2001 From: David Gomes <10091092+davidgomesdev@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:48:41 +0000 Subject: [PATCH] ci: add semantic release --- .github/workflows/release.yml | 25 ++++++++++--------------- .releaserc | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 .releaserc diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7374b2d..ce87277 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: Release on: push: - branches: ["main"] + branches: ["main", "cicd/add-semantic-release"] jobs: build-server: @@ -83,28 +83,23 @@ jobs: name: app.apk path: app.apk - upload: + release: needs: [build-server, build-app] runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 + - name: 📦 - Copy server artifacts uses: actions/download-artifact@v4 with: - path: . + path: artifacts/ merge-multiple: true - name: 🧐 - Display structure of downloaded artifacts - run: ls -R + run: ls -R artifacts/ - - name: 🌠 - Release - uses: ncipollo/release-action@v1.12.0 - with: - artifacts: "server-*,app.apk" - token: ${{ secrets.GITHUB_TOKEN }} - allowUpdates: true - removeArtifacts: true - artifactErrorsFailBuild: true - prerelease: true - name: Latest Pre-release - tag: latest + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..784cf76 --- /dev/null +++ b/.releaserc @@ -0,0 +1,18 @@ +{ + "release": { + "branches": ["master", "next"] + }, + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + [ + "@semantic-release/github", + { + "assets": [ + { "path": "server-*", "label": "Server binary" }, + { "path": "app.apk", "label": "App" } + ] + } + ] + ] +} \ No newline at end of file