Skip to content

Commit

Permalink
fix release names
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Jun 5, 2022
1 parent 11a9fe6 commit dc710c4
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 48 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/automatorserver-release.yaml

This file was deleted.

106 changes: 106 additions & 0 deletions .github/workflows/maestro_cli-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: maestro_cli publish

on:
push:
tags:
- "maestro_cli-v*"

jobs:
publish_cli:
runs-on: ubuntu-latest

defaults:
run:
working-directory: packages/maestro_cli

steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: 2.17.0

- name: Download pub.dev credentials
env:
CREDENTIALS: ${{ secrets.PUB_DEV_CREDENTIALS }}
run: |
mkdir -p ~/.pub-cache
echo $CREDENTIALS > ~/.pub-cache/credentials.json
# Not yet.
# - name: Publish
# run: dart pub publish -f

publish_server:
runs-on: ubuntu-latest
needs: publish_cli

defaults:
run:
working-directory: AutomatorServer

steps:
- name: Clone repository
uses: actions/checkout@v3
with:
# see https://github.com/actions/virtual-environments/issues/1717#issuecomment-702780142
ref: ${{ github.ref }}

- name: Set version, metadata, and artifact names
run: |
tag=${{ github.ref_name }}
prefix=maestro_cli-v
version=${tag#"$prefix"}
echo "version: $version"
server_file="server-$version.apk"
echo "server file: $server_file"
instrumentation_file="instrumentation-$version.apk"
echo "instrumentation file: $instrumentation_file"
echo "VERSION=$version" >> $GITHUB_ENV
echo "SERVER_FILE=$server_file" >> $GITHUB_ENV
echo "INSTRUMENTATION_FILE=$instrumentation_file" >> $GITHUB_ENV
# set whether is prerelease
is_prerelease=false
if [[ "$version" == 0.* ]]; then
is_prerelease=true
fi
echo "IS_PRERELEASE=$is_prerelease" >> $GITHUB_ENV
echo "is_prerelease: $is_prerelease"
# set release notes
tag_message="$(git tag -l --format='%(contents)' "$tag")"
echo "$tag_message" > release_notes.txt
echo "tag message: $tag_message"
- name: Build server APK
run: |
echo "server file: $SERVER_FILE"
./gradlew assembleDebug
mv app/build/outputs/apk/debug/app-debug.apk $SERVER_FILE
- name: Build instrumentation APK
run: |
echo "instrumentation file: $INSTRUMENTATION_FILE"
./gradlew assembleDebugAndroidTest
mv app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk $INSTRUMENTATION_FILE
- name: Create release
uses: softprops/action-gh-release@v1
with:
name: "maestro_cli-v${{ env.VERSION }}"
body_path: AutomatorServer/release_notes.txt
prerelease: ${{ env.IS_PRERELEASE }}
fail_on_unmatched_files: true
# see https://github.com/softprops/action-gh-release/issues/158
files: |
AutomatorServer/${{ env.SERVER_FILE }}
AutomatorServer/${{ env.INSTRUMENTATION_FILE }}
- name: Upload artifacts to Azure Storage
env:
AZURE_STORAGE_URL: https://lncdmaestrostorage.blob.core.windows.net/artifacts
AZURE_SAS_TOKEN: ${{ secrets.AZURE_SAS_TOKEN }}
run: |
./deploy ${{ env.SERVER_FILE }}
./deploy ${{ env.INSTRUMENTATION_FILE }}
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ void main() {
```

## Release process

1. Create a [git annotated tag][annotated_tag]:

```
git tag -a "maestro_cli-v0.0.4" -m "Release notes go here"
```

2. Push it! GitHub Actions will take care of the rest.

[pub_badge]: https://img.shields.io/pub/v/maestro.svg
[pub_link]: https://pub.dartlang.org/packages/maestro
[ui_automator]: https://developer.android.com/training/testing/other-components/ui-automator
[annotated_tag]: https://git-scm.com/book/en/v2/Git-Basics-Tagging#_annotated_tags

0 comments on commit dc710c4

Please sign in to comment.