-
Notifications
You must be signed in to change notification settings - Fork 5
66 lines (64 loc) · 2.31 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*' # tag pattern on pub.dev: 'v{{version}'
name: Publish to pub.dev
jobs:
build:
uses: ./.github/workflows/main.yml # use the callable tests job to run tests
publish:
needs: [ build ]
permissions:
id-token: write # Required for authentication using OIDC
contents: write
pull-requests: write
repository-projects: write
defaults:
run:
working-directory: server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
working-directory: server
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.22.2
- name: Install dependencies
run: flutter pub get
- name: Publish
run: dart pub publish --force
- uses: actions/download-artifact@v4
with:
name: Android build
- name: Display structure of downloaded files
run: ls -R $GITHUB_WORKSPACE
- uses: actions/download-artifact@v4
with:
name: ios-build
- name: Display structure of downloaded files
run: ls -R $GITHUB_WORKSPACE
- name: Upload Android Build to Release
uses: softprops/action-gh-release@v2
with:
files: |
${{ github.workspace }}/app-debug.apk
${{ github.workspace }}/ios.zip
- name: Update Flutter Driver with Version
run: |
TAG_NAME=$(curl -s "https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/tags" | grep -m 1 '"name"' | sed -E 's/.*"name": "([^"]+)".*/\1/')
repo_owner="AppiumTestDistribution"
repo_name="appium-flutter-integration-driver"
event_type="server-update"
service="Server to Driver"
version=$TAG_NAME
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"service\": \"$service\", \"version\": \"$version\", \"unit\": false, \"integration\": true}}"