diff --git a/.github/actions/release-notifier/action.yml b/.github/actions/release-notifier/action.yml new file mode 100644 index 000000000..0951b67e8 --- /dev/null +++ b/.github/actions/release-notifier/action.yml @@ -0,0 +1,54 @@ +name: 'Release Notifier' + +inputs: + os-name: + description: 'OS name (e.g. Linux, Android)' + required: true + version: + description: 'Semantic version string for this release (e.g. 4.0.0-alpha.0)' + required: true + status: + description: 'Final status of the release job (available values: success, failure, cancelled)' + required: true + slack_oauth_token: + description: 'OAuth token for our Slack bot' + required: true + +runs: + using: composite + steps: + - name: 'Success Notification' + uses: actions-ecosystem/action-slack-notifier@v1 + if: ${{ inputs.status == 'success' }} + with: + slack_token: ${{ inputs.slack_oauth_token }} + username: Github Actions + color: green + verbose: true + message: | + Release Success - `${{ inputs.os-name }} ${{ inputs.version }}` + channel: releases + + - name: 'Failure Notification' + uses: actions-ecosystem/action-slack-notifier@v1 + if: ${{ inputs.status == 'failure' }} + with: + slack_token: ${{ inputs.slack_oauth_token }} + username: Github Actions + color: red + verbose: true + message: | + Release Failed - `${{ inputs.os-name }} ${{ inputs.version }}` + channel: releases + + - name: 'Cancelled Notification' + uses: actions-ecosystem/action-slack-notifier@v1 + if: ${{ inputs.status == 'cancelled' }} + with: + slack_token: ${{ inputs.slack_oauth_token }} + username: Github Actions + color: yellow + verbose: true + message: | + Release Cancelled - `${{ inputs.os-name }} ${{ inputs.version }}` + channel: releases \ No newline at end of file diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 84db35107..3f3fe1e1f 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -38,6 +38,12 @@ jobs: with: submodules: 'recursive' + - name: Extract version + id: extract_version + uses: Saionaro/extract-package-version@fdb5b74adc1278ddb777dfed4c988b9d098bb48d # v1.2.1 + with: + path: packages/desktop + - name: Setup environment uses: ./.github/actions/setup-env with: @@ -80,22 +86,25 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} - - name: Get release version - id: package-version - uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # main - with: - path: packages/desktop - - name: Upload Release Assets uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 env: GITHUB_TOKEN: ${{ github.token }} with: upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ./packages/desktop/dist/Quiet-${{ steps.package-version.outputs.current-version}}.AppImage - asset_name: Quiet-${{ steps.package-version.outputs.current-version}}.AppImage + asset_path: ./packages/desktop/dist/Quiet-${{ steps.extract_version.outputs.current-version}}.AppImage + asset_name: Quiet-${{ steps.extract_version.outputs.current-version}}.AppImage asset_content_type: application/.AppImage + - name: Send Release Notificaton + uses: ./.github/actions/release-notifier + if: always() + with: + os-name: Linux + version: ${{ steps.extract_version.outputs.current-version }} + status: ${{ job.status }} + slack_oauth_token: ${{ secrets.SLACK_BOT_OAUTH_TOKEN }} + build-macos: # needs: run-e2e-tests-mac runs-on: macos-13 @@ -111,6 +120,12 @@ jobs: with: submodules: 'recursive' + - name: Extract version + id: extract_version + uses: Saionaro/extract-package-version@fdb5b74adc1278ddb777dfed4c988b9d098bb48d # v1.2.1 + with: + path: packages/desktop + - uses: actions-rs/components-nightly@254194ebf6ba07d2bb7cec8be76cee368d44fb90 # v1.1.1 with: component: clippy @@ -156,12 +171,6 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} - - name: Extract version - id: extract_version - uses: Saionaro/extract-package-version@fdb5b74adc1278ddb777dfed4c988b9d098bb48d # v1.2.1 - with: - path: packages/desktop - - name: Upload Release Assets uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 env: @@ -172,6 +181,15 @@ jobs: asset_name: Quiet-${{ steps.extract_version.outputs.version}}.dmg asset_content_type: application/.dmg + - name: Send Release Notificaton + uses: ./.github/actions/release-notifier + if: always() + with: + os-name: MacOS + version: ${{ steps.extract_version.outputs.current-version }} + status: ${{ job.status }} + slack_oauth_token: ${{ secrets.SLACK_BOT_OAUTH_TOKEN }} + build-windows: # needs: run-e2e-tests-win runs-on: windows-2019 @@ -187,6 +205,12 @@ jobs: with: submodules: 'recursive' + - name: Extract version + id: extract_version + uses: Saionaro/extract-package-version@fdb5b74adc1278ddb777dfed4c988b9d098bb48d # v1.2.1 + with: + path: packages/desktop + - name: "Fetch jsign" shell: bash run: cd packages/desktop && curl https://zbay-binaries.s3.us-east-2.amazonaws.com/jsign/jsign-2.1.jar --output ./jsign-2.1.jar @@ -234,13 +258,6 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} - - name: Extract version - id: extract_version - uses: Saionaro/extract-package-version@fdb5b74adc1278ddb777dfed4c988b9d098bb48d # v1.2.1 - with: - path: packages/desktop - - - name: Upload Release Assets uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 env: @@ -250,3 +267,12 @@ jobs: asset_path: ./packages/desktop/dist/Quiet Setup ${{ steps.extract_version.outputs.version}}.exe asset_name: Quiet Setup ${{ steps.extract_version.outputs.version}}.exe asset_content_type: application/.exe + + - name: Send Release Notificaton + uses: ./.github/actions/release-notifier + if: always() + with: + os-name: Windows + version: ${{ steps.extract_version.outputs.current-version }} + status: ${{ job.status }} + slack_oauth_token: ${{ secrets.SLACK_BOT_OAUTH_TOKEN }} diff --git a/.github/workflows/mobile-build-apk.yml b/.github/workflows/mobile-build-apk.yml index 360eb0df2..b92342508 100644 --- a/.github/workflows/mobile-build-apk.yml +++ b/.github/workflows/mobile-build-apk.yml @@ -24,6 +24,12 @@ jobs: with: submodules: 'recursive' + - name: Extract version + id: extract_version + uses: Saionaro/extract-package-version@fdb5b74adc1278ddb777dfed4c988b9d098bb48d # v1.2.1 + with: + path: packages/mobile + - name: "Set up JDK" uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0 with: @@ -88,3 +94,12 @@ jobs: asset_path: ./packages/mobile/android/app/build/outputs/apk/standard/release/app-standard-release.apk asset_name: app-standard-release.apk asset_content_type: application/.apk + + - name: Send Release Notificaton + uses: ./.github/actions/release-notifier + if: always() + with: + os-name: Android (APK) + version: ${{ steps.extract_version.outputs.current-version }} + status: ${{ job.status }} + slack_oauth_token: ${{ secrets.SLACK_BOT_OAUTH_TOKEN }} diff --git a/.github/workflows/mobile-deploy-android.yml b/.github/workflows/mobile-deploy-android.yml index d2c72855f..48de6f77e 100644 --- a/.github/workflows/mobile-deploy-android.yml +++ b/.github/workflows/mobile-deploy-android.yml @@ -24,6 +24,12 @@ jobs: with: submodules: 'recursive' + - name: Extract version + id: extract_version + uses: Saionaro/extract-package-version@fdb5b74adc1278ddb777dfed4c988b9d098bb48d # v1.2.1 + with: + path: packages/mobile + - name: "Set up JDK" uses: actions/setup-java@v3 with: @@ -125,3 +131,12 @@ jobs: status: completed track: internal whatsNewDirectory: distribution/whatsnew + + - name: Send Release Notificaton + uses: ./.github/actions/release-notifier + if: always() + with: + os-name: Android + version: ${{ steps.extract_version.outputs.current-version }} + status: ${{ job.status }} + slack_oauth_token: ${{ secrets.SLACK_BOT_OAUTH_TOKEN }} diff --git a/.github/workflows/mobile-deploy-ios.yml b/.github/workflows/mobile-deploy-ios.yml index 18f073265..7625838f1 100644 --- a/.github/workflows/mobile-deploy-ios.yml +++ b/.github/workflows/mobile-deploy-ios.yml @@ -25,6 +25,12 @@ jobs: submodules: 'recursive' lfs: true + - name: Extract version + id: extract_version + uses: Saionaro/extract-package-version@fdb5b74adc1278ddb777dfed4c988b9d098bb48d # v1.2.1 + with: + path: packages/mobile + - name: Install gpg run: brew install gnupg @@ -90,3 +96,12 @@ jobs: env: APPSTORE_USER: ${{ secrets.APPSTORE_USER }} APPSTORE_PASSWORD: ${{ secrets.APPSTORE_PASSWORD }} + + - name: Send Release Notificaton + uses: ./.github/actions/release-notifier + if: always() + with: + os-name: IOS + version: ${{ steps.extract_version.outputs.current-version }} + status: ${{ job.status }} + slack_oauth_token: ${{ secrets.SLACK_BOT_OAUTH_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 636ebdcaa..4dc000d4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Add `trace` level logs to `@quiet/logger` ([#2716](https://github.com/TryQuiet/quiet/issues/2716)) * Refactor the `StorageService` and create `ChannelService`, `MessageService` and `ChannelStore` for handling channel-related persistence ([#2631](https://github.com/TryQuiet/quiet/issues/2631)) +* Add slack notifications to release workflows ([#2722](https://github.com/TryQuiet/quiet/issues/2722)) ## [3.0.0]