rename port to flutter-server-port #17
Workflow file for this run
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
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}}" |