Publish new version #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish new version | |
on: | |
workflow_run: | |
workflows: ["Update files"] | |
types: | |
- completed | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
tag_version: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
name: Tag version and create release | |
runs-on: [self-hosted, macOS] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Switch to SSH | |
run: git remote set-url origin git@github.com:landamessenger/zstandard.git | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Get latest pull request info | |
id: pr_info | |
uses: octokit/request-action@v2.4.0 | |
with: | |
route: GET /repos/${{ github.repository }}/pulls?state=closed&sort=updated&direction=desc&per_page=1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Debug pull request data | |
run: | | |
echo "PR data: ${{ steps.pr_info.outputs.data }}" | |
- name: Create tag | |
id: create_tag | |
run: | | |
# Checks if the tag already exists in the remote repository | |
if git rev-parse "v${{ env.VERSION }}" >/dev/null 2>&1; then | |
echo "Error: Tag v${{ env.VERSION }} already exists." | |
exit 1 | |
fi | |
# Check if the version was found | |
if [ -z "${{ env.VERSION }}" ]; then | |
echo "Error: No version found in pubspec.yml" | |
exit 1 | |
fi | |
git tag "v${{ env.VERSION }}" | |
git push origin "v${{ env.VERSION }}" | |
- name: Parse pull request info | |
if: ${{ steps.pr_info.outputs.data }} | |
id: parse_pr | |
run: | | |
PR_TITLE=$(echo '${{ steps.pr_info.outputs.data }}' | jq -r '.[0].title') | |
PR_BODY=$(echo '${{ steps.pr_info.outputs.data }}' | jq -r '.[0].body') | |
echo "PR_TITLE=$PR_TITLE" >> $GITHUB_ENV | |
echo "PR_BODY=$PR_BODY" >> $GITHUB_ENV | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create release | |
if: ${{ steps.create_tag.outcome == 'success' }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: "v${{ env.VERSION }}" | |
name: "${{ env.PR_TITLE }}" | |
body: "${{ env.PR_BODY }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Creation Tag Failed" \ | |
--body "${{ github.repository }}: Tag v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Creation Tag Canceled" \ | |
--body "${{ github.repository }}: Tag v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Creation Tag Passed" \ | |
--body "${{ github.repository }}: Tag v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
platform_interface_analyze: | |
name: Analyze Platform Interface | |
runs-on: [self-hosted, macOS] | |
needs: tag_version | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_platform_interface | |
run: flutter pub get | |
- name: Analyze check | |
working-directory: zstandard_platform_interface | |
run: flutter analyze | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Analyze - Platform Interface Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Analyze - Platform Interface Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Analyze - Platform Interface Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
platform_interface_test: | |
name: Test Platform Interface | |
runs-on: [self-hosted, macOS] | |
needs: tag_version | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_platform_interface | |
run: flutter pub get | |
- name: Test check | |
working-directory: zstandard_platform_interface | |
run: flutter test | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Test - Platform Interface Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Test - Platform Interface Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Test - Platform Interface Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
platform_interface_publish_dry_run: | |
name: Dry Run Publish Platform Interface | |
runs-on: [self-hosted, macOS] | |
needs: tag_version | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_platform_interface | |
run: flutter pub get | |
- name: Publish Dry Run | |
working-directory: zstandard_platform_interface | |
run: dart pub publish --dry-run | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Platform Interface Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Platform Interface Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Platform Interface Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
platform_interface_publish: | |
name: Publish Platform Interface | |
runs-on: [self-hosted, macOS] | |
needs: [platform_interface_analyze, platform_interface_test, platform_interface_publish_dry_run] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_platform_interface | |
run: flutter pub get | |
- name: Publish | |
working-directory: zstandard_platform_interface | |
run: dart pub publish -f | |
- name: Compress folder | |
run: zip -r zstandard_platform_interface.zip ./zstandard_platform_interface | |
- name: Upload asset to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: "v${{ env.VERSION }}" | |
files: "./zstandard_platform_interface.zip" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Wait for dependency to be available | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 120 | |
max_attempts: 200 | |
command: cd zstandard_android && flutter pub get | |
on_retry_command: | | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Retry getting dependencies" \ | |
--body "Getting dependencies. It could take a while.." \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#FFFFFFFF" \ | |
--text_color "#DD000000" | |
- name: Wait a minute | |
run: sleep 120 | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Platform Interface Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Platform Interface Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Platform Interface Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
android_analyze: | |
name: Analyze Android | |
runs-on: [self-hosted, macOS] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_android | |
run: flutter pub get | |
- name: Analyze check | |
working-directory: zstandard_android | |
run: flutter analyze | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Analyze - Android Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Analyze - Android Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Analyze - Android Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
android_test: | |
name: Test Android | |
runs-on: [self-hosted, macOS] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_android | |
run: flutter pub get | |
- name: Test check | |
working-directory: zstandard_android | |
run: flutter test | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Test - Android Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Test - Android Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Test - Android Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
android_publish_dry_run: | |
name: Dry Run Publish Android | |
runs-on: [self-hosted, macOS] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_android | |
run: flutter pub get | |
- name: Publish Dry Run | |
working-directory: zstandard_android | |
run: dart pub publish --dry-run | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Dry Run Publish - Android Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Dry Run Publish - Android Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Dry Run Publish - Android Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
android_publish: | |
name: Publish Android | |
runs-on: [self-hosted, macOS] | |
needs: [android_analyze, android_test, android_publish_dry_run] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_android | |
run: flutter pub get | |
- name: Publish | |
working-directory: zstandard_android | |
run: dart pub publish -f | |
- name: Compress folder | |
run: zip -r zstandard_android.zip ./zstandard_android | |
- name: Upload asset to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: "v${{ env.VERSION }}" | |
files: "./zstandard_android.zip" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Publish - Android Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Publish - Android Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Publish - Android Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
ios_analyze: | |
name: Analyze iOS | |
runs-on: [self-hosted, macOS] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_ios | |
run: flutter pub get | |
- name: Analyze check | |
working-directory: zstandard_ios | |
run: flutter analyze | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Analyze - iOS Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Analyze - iOS Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Analyze - iOS Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
ios_test: | |
name: Test iOS | |
runs-on: [self-hosted, macOS] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_ios | |
run: flutter pub get | |
- name: Test check | |
working-directory: zstandard_ios | |
run: flutter test | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Test - iOS Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Test - iOS Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Test - iOS Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
ios_publish_dry_run: | |
name: Dry Run Publish iOS | |
runs-on: [self-hosted, macOS] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_ios | |
run: flutter pub get | |
- name: Publish Dry Run | |
working-directory: zstandard_ios | |
run: dart pub publish --dry-run | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Dry Run Publish - iOS Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Dry Run Publish - iOS Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Dry Run Publish - iOS Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
ios_publish: | |
name: Publish iOS | |
runs-on: [self-hosted, macOS] | |
needs: [ios_analyze, ios_test, ios_publish_dry_run] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_ios | |
run: flutter pub get | |
- name: Publish | |
working-directory: zstandard_ios | |
run: dart pub publish -f | |
- name: Compress folder | |
run: zip -r zstandard_ios.zip ./zstandard_ios | |
- name: Upload asset to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: "v${{ env.VERSION }}" | |
files: "./zstandard_ios.zip" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Publish - iOS Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Publish - iOS Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Publish - iOS Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
macos_analyze: | |
name: Analyze macOS | |
runs-on: [self-hosted, macOS] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_macos | |
run: flutter pub get | |
- name: Analyze check | |
working-directory: zstandard_macos | |
run: flutter analyze | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Analyze - macOS Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Analyze - macOS Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Analyze - macOS Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
macos_test: | |
name: Test macOS | |
runs-on: [self-hosted, macOS] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Test check | |
working-directory: zstandard_macos | |
run: flutter test | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Test - macOS Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Test - macOS Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Test - macOS Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
macos_publish_dry_run: | |
name: Dry Run Publish macOS | |
runs-on: [self-hosted, macOS] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_macos | |
run: flutter pub get | |
- name: Publish Dry Run | |
working-directory: zstandard_macos | |
run: dart pub publish --dry-run | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Dry Run Publish - macOS Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Dry Run Publish - macOS Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Dry Run Publish - macOS Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
macos_publish: | |
name: Publish macOS | |
runs-on: [self-hosted, macOS] | |
needs: [macos_analyze, macos_test, macos_publish_dry_run] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_macos | |
run: flutter pub get | |
- name: Publish | |
working-directory: zstandard_macos | |
run: dart pub publish -f | |
- name: Compress folder | |
run: zip -r zstandard_macos.zip ./zstandard_macos | |
- name: Upload asset to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: "v${{ env.VERSION }}" | |
files: "./zstandard_macos.zip" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Publish - macOS Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Publish - macOS Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Publish - macOS Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
windows_analyze: | |
name: Analyze Windows | |
runs-on: [self-hosted, Windows] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
shell: cmd | |
run: npm install -g @landamessenger/landa-messenger-api | |
- name: Get dependencies | |
working-directory: zstandard_windows | |
shell: cmd | |
run: flutter pub get | |
- name: Analyze check | |
working-directory: zstandard_windows | |
shell: cmd | |
run: flutter analyze | |
- name: Handle job completion | |
if: always() | |
shell: cmd | |
run: | | |
if "%{{ job.status }}" == "failure" ( | |
landa-messenger-api chat-send ^ | |
--id "%{{ secrets.CHAT_ID }}" ^ | |
--api_key "%{{ secrets.CHAT_KEY }}" ^ | |
--title "π΄ Analyze - Windows Failed" ^ | |
--body "%{{ github.repository }}: Tag v%{{ env.VERSION }}" ^ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ | |
--background_color "#55000000" ^ | |
--text_color "#FFFFFFFF" | |
) else if "%{{ job.status }}" == "cancelled" ( | |
landa-messenger-api chat-send ^ | |
--id "%{{ secrets.CHAT_ID }}" ^ | |
--api_key "%{{ secrets.CHAT_KEY }}" ^ | |
--title "π Analyze - Windows Canceled" ^ | |
--body "%{{ github.repository }}: Tag v%{{ env.VERSION }}" ^ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ | |
--background_color "#55000000" ^ | |
--text_color "#FFFFFFFF" | |
) else ( | |
landa-messenger-api chat-send ^ | |
--id "%{{ secrets.CHAT_ID }}" ^ | |
--api_key "%{{ secrets.CHAT_KEY }}" ^ | |
--title "π’ Analyze - Windows Passed" ^ | |
--body "%{{ github.repository }}: Tag v%{{ env.VERSION }}" ^ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ | |
--background_color "#55000000" ^ | |
--text_color "#FFFFFFFF" | |
) | |
windows_test: | |
name: Test Windows | |
runs-on: [self-hosted, Windows] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
shell: cmd | |
run: npm install -g @landamessenger/landa-messenger-api | |
- name: Get dependencies | |
working-directory: zstandard_windows | |
shell: cmd | |
run: flutter pub get | |
#- name: Test check | |
# working-directory: zstandard_windows | |
# shell: cmd | |
# run: flutter test | |
- name: Handle job completion | |
if: always() | |
shell: cmd | |
run: | | |
if "%{{ job.status }}" == "failure" ( | |
landa-messenger-api chat-send ^ | |
--id "%{{ secrets.CHAT_ID }}" ^ | |
--api_key "%{{ secrets.CHAT_KEY }}" ^ | |
--title "π΄ Test - Windows Failed" ^ | |
--body "%{{ github.repository }}: Tag v%{{ env.VERSION }}" ^ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ | |
--background_color "#55000000" ^ | |
--text_color "#FFFFFFFF" | |
) else if "%{{ job.status }}" == "cancelled" ( | |
landa-messenger-api chat-send ^ | |
--id "%{{ secrets.CHAT_ID }}" ^ | |
--api_key "%{{ secrets.CHAT_KEY }}" ^ | |
--title "π Test - Windows Canceled" ^ | |
--body "%{{ github.repository }}: Tag v%{{ env.VERSION }}" ^ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ | |
--background_color "#55000000" ^ | |
--text_color "#FFFFFFFF" | |
) else ( | |
landa-messenger-api chat-send ^ | |
--id "%{{ secrets.CHAT_ID }}" ^ | |
--api_key "%{{ secrets.CHAT_KEY }}" ^ | |
--title "π’ Test - Windows Passed" ^ | |
--body "%{{ github.repository }}: Tag v%{{ env.VERSION }}" ^ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ | |
--background_color "#55000000" ^ | |
--text_color "#FFFFFFFF" | |
) | |
windows_publish_dry_run: | |
name: Dry Run Publish Windows | |
runs-on: [self-hosted, Windows] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
shell: cmd | |
run: npm install -g @landamessenger/landa-messenger-api | |
- name: Get dependencies | |
working-directory: zstandard_windows | |
shell: cmd | |
run: flutter pub get | |
- name: Publish Dry Run | |
working-directory: zstandard_windows | |
shell: cmd | |
run: dart pub publish --dry-run | |
- name: Handle job completion | |
if: always() | |
shell: cmd | |
run: | | |
if "%{{ job.status }}" == "failure" ( | |
landa-messenger-api chat-send ^ | |
--id "%{{ secrets.CHAT_ID }}" ^ | |
--api_key "%{{ secrets.CHAT_KEY }}" ^ | |
--title "π΄ Dry Run Publish - Windows Failed" ^ | |
--body "%{{ github.repository }}: Tag v%{{ env.VERSION }}" ^ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ | |
--background_color "#55000000" ^ | |
--text_color "#FFFFFFFF" | |
) else if "%{{ job.status }}" == "cancelled" ( | |
landa-messenger-api chat-send ^ | |
--id "%{{ secrets.CHAT_ID }}" ^ | |
--api_key "%{{ secrets.CHAT_KEY }}" ^ | |
--title "π Dry Run Publish - Windows Canceled" ^ | |
--body "%{{ github.repository }}: Tag v%{{ env.VERSION }}" ^ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ | |
--background_color "#55000000" ^ | |
--text_color "#FFFFFFFF" | |
) else ( | |
landa-messenger-api chat-send ^ | |
--id "%{{ secrets.CHAT_ID }}" ^ | |
--api_key "%{{ secrets.CHAT_KEY }}" ^ | |
--title "π’ Dry Run Publish - Windows Passed" ^ | |
--body "%{{ github.repository }}: Tag v%{{ env.VERSION }}" ^ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ | |
--background_color "#55000000" ^ | |
--text_color "#FFFFFFFF" | |
) | |
windows_publish: | |
name: Publish Windows | |
runs-on: [self-hosted, Windows] | |
needs: [windows_analyze, windows_test, windows_publish_dry_run] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
shell: cmd | |
run: npm install -g @landamessenger/landa-messenger-api | |
- name: Get dependencies | |
working-directory: zstandard_windows | |
shell: cmd | |
run: flutter pub get | |
- name: Publish | |
working-directory: zstandard_windows | |
shell: cmd | |
run: dart pub publish -f | |
- name: Compress folder | |
shell: cmd | |
run: tar -a -c -f zstandard_windows.zip zstandard_windows | |
- name: Upload asset to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: "v${{ env.VERSION }}" | |
files: "./zstandard_windows.zip" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Handle job completion | |
if: always() | |
shell: cmd | |
run: | | |
if "%{{ job.status }}" == "failure" ( | |
landa-messenger-api chat-send ^ | |
--id "%{{ secrets.CHAT_ID }}" ^ | |
--api_key "%{{ secrets.CHAT_KEY }}" ^ | |
--title "π΄ Publish - Windows Failed" ^ | |
--body "%{{ github.repository }}: Tag v%{{ env.VERSION }}" ^ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ | |
--background_color "#55000000" ^ | |
--text_color "#FFFFFFFF" | |
) else if "%{{ job.status }}" == "cancelled" ( | |
landa-messenger-api chat-send ^ | |
--id "%{{ secrets.CHAT_ID }}" ^ | |
--api_key "%{{ secrets.CHAT_KEY }}" ^ | |
--title "π Publish - Windows Canceled" ^ | |
--body "%{{ github.repository }}: Tag v%{{ env.VERSION }}" ^ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ | |
--background_color "#55000000" ^ | |
--text_color "#FFFFFFFF" | |
) else ( | |
landa-messenger-api chat-send ^ | |
--id "%{{ secrets.CHAT_ID }}" ^ | |
--api_key "%{{ secrets.CHAT_KEY }}" ^ | |
--title "π’ Publish - Windows Passed" ^ | |
--body "%{{ github.repository }}: Tag v%{{ env.VERSION }}" ^ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ | |
--background_color "#55000000" ^ | |
--text_color "#FFFFFFFF" | |
) | |
linux_analyze: | |
name: Analyze Linux | |
runs-on: [self-hosted, Linux] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_linux | |
run: flutter pub get | |
- name: Analyze check | |
working-directory: zstandard_linux | |
run: flutter analyze | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Analyze - Linux Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Analyze - Linux Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Analyze - Linux Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
linux_test: | |
name: Test Linux | |
runs-on: [self-hosted, Linux] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_linux | |
run: flutter pub get | |
# - name: Test check | |
# working-directory: zstandard_linux | |
# run: flutter test | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Test - Linux Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Test - Linux Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Test - Linux Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
linux_publish_dry_run: | |
name: Dry Run Publish Linux | |
runs-on: [self-hosted, Linux] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_linux | |
run: flutter pub get | |
- name: Publish Dry Run | |
working-directory: zstandard_linux | |
run: dart pub publish --dry-run | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Dry Run Publish - Linux Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Dry Run Publish - Linux Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Dry Run Publish - Linux Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
linux_publish: | |
name: Publish Linux | |
runs-on: [self-hosted, Linux] | |
needs: [linux_analyze, linux_test, linux_publish_dry_run] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_linux | |
run: flutter pub get | |
- name: Publish | |
working-directory: zstandard_linux | |
run: dart pub publish -f | |
- name: Compress folder | |
run: zip -r zstandard_linux.zip ./zstandard_linux | |
- name: Upload asset to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: "v${{ env.VERSION }}" | |
files: "./zstandard_linux.zip" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Publish - Linux Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Publish - Linux Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Publish - Linux Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
web_analyze: | |
name: Analyze Web | |
runs-on: [self-hosted, macOS] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_web | |
run: flutter pub get | |
- name: Analyze check | |
working-directory: zstandard_web | |
run: flutter analyze | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Analyze - Web Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Analyze - Web Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Analyze - Web Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
web_test: | |
name: Test Web | |
runs-on: [self-hosted, macOS] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_web | |
run: flutter pub get | |
- name: Test check | |
working-directory: zstandard_web | |
run: flutter test | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Test - Web Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Test - Web Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Test - Web Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
web_publish_dry_run: | |
name: Dry Run Publish Web | |
runs-on: [self-hosted, macOS] | |
needs: platform_interface_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_web | |
run: flutter pub get | |
- name: Publish Dry Run | |
working-directory: zstandard_web | |
run: dart pub publish --dry-run | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Dry Run Publish - Web Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Dry Run Publish - Web Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Dry Run Publish - Web Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
web_publish: | |
name: Publish Web | |
runs-on: [self-hosted, macOS] | |
needs: [web_analyze, web_test, web_publish_dry_run] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_web | |
run: flutter pub get | |
- name: Publish | |
working-directory: zstandard_web | |
run: dart pub publish -f | |
- name: Compress folder | |
run: zip -r zstandard_web.zip ./zstandard_web | |
- name: Upload asset to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: "v${{ env.VERSION }}" | |
files: "./zstandard_web.zip" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Publish - Web Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Publish - Web Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Publish - Web Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
cli_analyze: | |
name: Analyze CLI | |
runs-on: [self-hosted, macOS] | |
needs: [android_publish, ios_publish, web_publish, macos_publish, linux_publish, windows_publish] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_cli | |
run: dart pub get | |
- name: Analyze check | |
working-directory: zstandard_cli | |
run: dart analyze | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Analyze - CLI Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Analyze - CLI Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Analyze - CLI Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
cli_test: | |
name: Test CLI | |
runs-on: [self-hosted, macOS] | |
needs: [android_publish, ios_publish, web_publish, macos_publish, linux_publish, windows_publish] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_cli | |
run: dart pub get | |
- name: Test check | |
working-directory: zstandard_cli | |
run: dart test | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Test - CLI Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Test - CLI Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Test - CLI Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
cli_publish_dry_run: | |
name: Dry Run Publish CLI | |
runs-on: [self-hosted, macOS] | |
needs: [android_publish, ios_publish, web_publish, macos_publish, linux_publish, windows_publish] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_cli | |
run: dart pub get | |
- name: Publish Dry Run | |
working-directory: zstandard_cli | |
run: dart pub publish --dry-run | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Dry Run Publish - CLI Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Dry Run Publish - CLI Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Dry Run Publish - CLI Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
cli_publish: | |
name: Publish CLI | |
runs-on: [self-hosted, macOS] | |
needs: [cli_analyze, cli_test, cli_publish_dry_run] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard_cli | |
run: dart pub get | |
- name: Publish | |
working-directory: zstandard_cli | |
run: dart pub publish -f | |
- name: Compress folder | |
run: zip -r zstandard_cli.zip ./zstandard_cli | |
- name: Upload asset to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: "v${{ env.VERSION }}" | |
files: "./zstandard_cli.zip" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Publish - CLI Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Publish - CLI Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Publish - CLI Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
zstandard_analyze: | |
name: Analyze Zstandard | |
runs-on: [self-hosted, macOS] | |
needs: [android_publish, ios_publish, web_publish, macos_publish, linux_publish, windows_publish] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Wait for dependency to be available | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 120 | |
max_attempts: 200 | |
command: cd zstandard && flutter pub get | |
on_retry_command: | | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Retry getting dependencies" \ | |
--body "Getting dependencies. It could take a while.." \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#FFFFFFFF" \ | |
--text_color "#DD000000" | |
- name: Wait a minute | |
run: sleep 120 | |
- name: Analyze check | |
working-directory: zstandard | |
run: flutter analyze | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Analyze - Zstandard Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Analyze - Zstandard Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Analyze - Zstandard Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
zstandard_test: | |
name: Test Zstandard | |
runs-on: [self-hosted, macOS] | |
needs: [android_publish, ios_publish, web_publish, macos_publish, linux_publish, windows_publish] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Wait for dependency to be available | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 120 | |
max_attempts: 200 | |
command: cd zstandard && flutter pub get | |
on_retry_command: | | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Retry getting dependencies" \ | |
--body "Getting dependencies. It could take a while.." \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#FFFFFFFF" \ | |
--text_color "#DD000000" | |
- name: Wait a minute | |
run: sleep 120 | |
- name: Test check | |
working-directory: zstandard | |
run: flutter test | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Test - Zstandard Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Test - Zstandard Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Test - Zstandard Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
zstandard_publish_dry_run: | |
name: Dry Run Publish Zstandard | |
runs-on: [self-hosted, macOS] | |
needs: [android_publish, ios_publish, web_publish, macos_publish, linux_publish, windows_publish] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Wait for dependency to be available | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 120 | |
max_attempts: 200 | |
command: cd zstandard && flutter pub get | |
on_retry_command: | | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Retry getting dependencies" \ | |
--body "Getting dependencies. It could take a while.." \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#FFFFFFFF" \ | |
--text_color "#DD000000" | |
- name: Wait a minute | |
run: sleep 120 | |
- name: Publish Dry Run | |
working-directory: zstandard | |
run: dart pub publish --dry-run | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Dry Run Publish - Zstandard Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Dry Run Publish - Zstandard Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Dry Run Publish - Zstandard Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi | |
zstandard_publish: | |
name: Publish Zstandard | |
runs-on: [self-hosted, macOS] | |
needs: [zstandard_analyze, zstandard_test, zstandard_publish_dry_run] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Install Landa Messenger CLI | |
run: npm install @landamessenger/landa-messenger-api -g | |
- name: Read version from pubspec.yml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
run: | | |
VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.3' | |
- name: Get dependencies | |
working-directory: zstandard | |
run: flutter pub get | |
- name: Publish | |
working-directory: zstandard | |
run: dart pub publish -f | |
- name: Compress folder | |
run: zip -r zstandard.zip ./zstandard | |
- name: Upload asset to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: "v${{ env.VERSION }}" | |
files: "./zstandard.zip" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Handle job completion | |
if: always() | |
run: | | |
if [ "${{ job.status }}" == "failure" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π΄ Publish - Zstandard Failed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
elif [ "${{ job.status }}" == "cancelled" ]; then | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π Publish - Zstandard Canceled" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
else | |
landa-messenger-api chat-send \ | |
--id "${{ secrets.CHAT_ID }}" \ | |
--api_key "${{ secrets.CHAT_KEY }}" \ | |
--title "π’ Publish - Zstandard Passed" \ | |
--body "${{ github.repository }}: v${{ env.VERSION }}" \ | |
--url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ | |
--image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ | |
--background_color "#55000000" \ | |
--text_color "#FFFFFFFF" | |
fi |