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..d8cb549 --- /dev/null +++ b/.releaserc @@ -0,0 +1,15 @@ +{ + "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