feature: updated version and workflows #63
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: Push Checks Windows | |
on: | |
push: | |
branches: | |
- '**' | |
- '!master' | |
#paths: | |
# - "zstandard_windows/**" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check_windows_analyze: | |
name: Analyze Windows | |
runs-on: [self-hosted, Windows] | |
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 for ${{ env.VERSION }} | |
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 | |
env: | |
CHAT_ID: ${{ secrets.CHAT_ID }} | |
CHAT_KEY: ${{ secrets.CHAT_KEY }} | |
REPO: ${{ github.repository }} | |
VERSION: ${{ steps.read_version.outputs.version }} | |
JOB_STATUS: ${{ job.status }} | |
run: | | |
for /f "tokens=2 delims=: " %%a in ('findstr "^version: " pubspec.yaml') do set VERSION=%%a | |
echo The VERSION is: %VERSION% | |
if "%JOB_STATUS%" == "failure" ( | |
landa-messenger-api chat-send ^ | |
--id "%CHAT_ID%" ^ | |
--api_key "%CHAT_KEY%" ^ | |
--title "π΄ Analyze - Windows Failed" ^ | |
--body "%REPO%: v%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 "%CHAT_ID%" ^ | |
--api_key "%CHAT_KEY%" ^ | |
--title "π Analyze - Windows Canceled" ^ | |
--body "%REPO%: v%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 "%CHAT_ID%" ^ | |
--api_key "%CHAT_KEY%" ^ | |
--title "π’ Analyze - Windows Passed" ^ | |
--body "%REPO%: v%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" | |
) | |
check_windows_test: | |
name: Test Windows | |
runs-on: [self-hosted, Windows] | |
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: Read version from pubspec.yaml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
shell: cmd | |
run: | | |
for /f "tokens=2 delims= " %%a in ('findstr "^version: " pubspec.yaml') do set VERSION=%%a | |
echo VERSION=%VERSION% >> %GITHUB_ENV% | |
- 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 | |
env: | |
CHAT_ID: ${{ secrets.CHAT_ID }} | |
CHAT_KEY: ${{ secrets.CHAT_KEY }} | |
REPO: ${{ github.repository }} | |
VERSION: ${{ env.VERSION }} | |
JOB_STATUS: ${{ job.status }} | |
run: | | |
if "%JOB_STATUS%" == "failure" ( | |
landa-messenger-api chat-send ^ | |
--id "%CHAT_ID%" ^ | |
--api_key "%CHAT_KEY%" ^ | |
--title "π΄ Test - Windows Failed" ^ | |
--body "%REPO%: v%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 "%CHAT_ID%" ^ | |
--api_key "%CHAT_KEY%" ^ | |
--title "π Test - Windows Canceled" ^ | |
--body "%REPO%: v%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 "%CHAT_ID%" ^ | |
--api_key "%CHAT_KEY%" ^ | |
--title "π’ Test - Windows Passed" ^ | |
--body "%REPO%: v%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" | |
) | |
check_windows_publish_dry_run: | |
name: Dry Run Publish Windows | |
runs-on: [self-hosted, Windows] | |
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: Read version from pubspec.yaml | |
working-directory: zstandard_platform_interface | |
id: read_version | |
shell: cmd | |
run: | | |
for /f "tokens=2 delims= " %%a in ('findstr "^version: " pubspec.yaml') do set VERSION=%%a | |
echo VERSION=%VERSION% >> %GITHUB_ENV% | |
- 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 | |
env: | |
CHAT_ID: ${{ secrets.CHAT_ID }} | |
CHAT_KEY: ${{ secrets.CHAT_KEY }} | |
REPO: ${{ github.repository }} | |
VERSION: ${{ env.VERSION }} | |
JOB_STATUS: ${{ job.status }} | |
run: | | |
if "%JOB_STATUS%" == "failure" ( | |
landa-messenger-api chat-send ^ | |
--id "%CHAT_ID%" ^ | |
--api_key "%CHAT_KEY%" ^ | |
--title "π΄ Dry Run Publish - Windows Failed" ^ | |
--body "%REPO%: v%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 "%CHAT_ID%" ^ | |
--api_key "%CHAT_KEY%" ^ | |
--title "π Dry Run Publish - Windows Canceled" ^ | |
--body "%REPO%: v%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 "%CHAT_ID%" ^ | |
--api_key "%CHAT_KEY%" ^ | |
--title "π’ Dry Run Publish - Windows Passed" ^ | |
--body "%REPO%: v%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" | |
) |