Polish release workflow (#207)

* Do run tests in beta

- Test and build app in same lane
- Run tests with swift directly
- Set timeout on build only
- Set GYM_OUTPUT_DIRECTORY inline
- Fix bad build number, broken in db075eb
- Ignore updates to CHANGELOG for testing
- Drop unnecessary exports
- Drop unnecessary test env
- Drop unused PLATFORM .env.* variable

* Work around gym issues in CI

- Set custom build paths for proper clean-up
- Disable xcpretty (seems to hang job)

* Add descriptive names to workflow

- Rename beta to release
- Add job names

* Optimize release workflow

- Use a matrix for multiplatform build
- Only preinstall platform-specific certificates
- Output app version/build early for job reuse
- Do not depend app review on public beta release
- Pull latest commits before pushing/tagging

In release, ci/* scripts require Ruby. Make version an argument
of the commit-release.sh script to fix dependency.

* Import secret to notify external testers or not

* [ci skip] Add CHANGELOG preface in local scripts

* [ci skip] Update links to release via CI
This commit is contained in:
Davide De Rosa 2021-12-03 15:31:19 +01:00 committed by GitHub
parent 56f6e289c9
commit 2a5c231d3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 147 additions and 94 deletions

1
.beta-base Normal file
View File

@ -0,0 +1 @@
1072

1
.env
View File

@ -1,4 +1,3 @@
# constant (fastlane)
LC_ALL="en_US.UTF-8"
LANG="en_US.UTF-8"
BASE_BUILD_NUMBER="1071"

View File

@ -3,7 +3,6 @@ MATCH_TYPE="appstore"
GYM_EXPORT_METHOD="app-store"
GYM_SKIP_PACKAGE_PKG="false"
SCAN_PACKAGE_PATH="PassepartoutCore"
SCAN_SCHEME="PassepartoutCore"
DEMO_ACCOUNT_REQUIRED="true"
PILOT_DISTRIBUTE_EXTERNAL="true"
PILOT_BETA_APP_DESCRIPTION="Passepartout is a non-official, user-friendly OpenVPN® client."

View File

@ -1,4 +1,3 @@
PLATFORM="ios"
APP_ROOT="Passepartout/App/iOS"
MATCH_PLATFORM="ios"
GYM_SCHEME="Passepartout-iOS"

View File

@ -1,4 +1,3 @@
PLATFORM="mac"
APP_ROOT="Passepartout/App/macOS"
MATCH_PLATFORM="macos"
MATCH_ADDITIONAL_CERT_TYPES="mac_installer_distribution"

View File

@ -1,4 +1,8 @@
name: 'Prepare build environment'
inputs:
platform:
description: 'Platform for match'
required: true
runs:
using: 'composite'
steps:
@ -11,4 +15,4 @@ runs:
- shell: bash
run: |
scripts/ci/recognize-match-hostname.sh
bundle exec fastlane preinstall_development_certs
bundle exec fastlane --env ${{ inputs.platform }} preinstall_development_certs

View File

@ -1,4 +1,4 @@
name: Public Beta
name: Release
on:
push:
@ -21,52 +21,74 @@ env:
PILOT_GROUPS: ${{ secrets.PILOT_GROUPS }}
PILOT_BETA_APP_FEEDBACK: ${{ secrets.PILOT_BETA_APP_FEEDBACK }}
PILOT_BETA_APP_REVIEW_INFO: ${{ secrets.PILOT_BETA_APP_REVIEW_INFO }}
PILOT_NOTIFY_EXTERNAL_TESTERS: ${{ secrets.PILOT_NOTIFY_EXTERNAL_TESTERS }}
CHANGELOG_PREFACE: ${{ secrets.CHANGELOG_PREFACE }}
jobs:
build_upload_ios:
build_upload:
name: Upload to ASC
runs-on: macos-11
timeout-minutes: 60
strategy:
fail-fast: true
matrix:
name: ["iOS", "macOS"]
include:
- name: "iOS"
platform: "ios"
use_version: true
- name: "macOS"
platform: "mac"
env:
PLATFORM: ${{ matrix.platform }}
GYM_OUTPUT_DIRECTORY: "dist/${{ matrix.platform }}"
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Prepare build
uses: ./.github/actions/prepare-build-app
- name: Build iOS (.ipa)
run: |
bundle exec fastlane --env ios,beta create_archive
- name: Submit to TestFlight
run: |
export PILOT_CHANGELOG=`ci/build-changelog.sh ios`
export PILOT_IPA="dist/ios/Passepartout.ipa"
bundle exec fastlane --env ios,beta store_beta
build_upload_mac:
runs-on: macos-11
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Prepare build
uses: ./.github/actions/prepare-build-app
- name: Build macOS (.pkg)
platform: ${{ matrix.platform }}
- name: Store app version
id: app_version
if: ${{ matrix.use_version }}
run: |
bundle exec fastlane --env mac,beta create_archive
VERSION=`ci/version-number.sh $PLATFORM`
BUILD=`ci/build-number.sh $PLATFORM`
echo "::set-output name=version::$VERSION"
echo "::set-output name=build::$BUILD"
- name: Run tests
run: |
cd PassepartoutCore
swift test
- name: Build ${{ matrix.name }} app
timeout-minutes: 15
run: |
bundle exec fastlane --env $PLATFORM,beta test_and_build_app test:false
- name: Submit to TestFlight
run: |
export PILOT_CHANGELOG=`ci/build-changelog.sh mac`
export PILOT_PKG="dist/mac/Passepartout.pkg"
bundle exec fastlane --env mac,beta store_beta
release_public_beta:
if [ $PLATFORM == "ios" ]; then
export PILOT_IPA="$GYM_OUTPUT_DIRECTORY/Passepartout.ipa"
else
export PILOT_PKG="$GYM_OUTPUT_DIRECTORY/Passepartout.pkg"
fi
export PILOT_CHANGELOG=`ci/build-changelog.sh $PLATFORM`
bundle exec fastlane --env $PLATFORM,beta run pilot
outputs:
version: ${{ steps.app_version.outputs.version }}
build: ${{ steps.app_version.outputs.build }}
distribute_public_beta:
name: Distribute Public Beta
runs-on: ubuntu-latest
needs: [build_upload_ios, build_upload_mac]
needs: build_upload
environment:
name: public_beta
url: https://testflight.apple.com/join/K71mtLjZ
url: "https://testflight.apple.com/join/K71mtLjZ"
env:
PILOT_USERNAME: ${{ secrets.PILOT_USERNAME }}
PILOT_GROUPS: ${{ secrets.PILOT_GROUPS }}
PILOT_APP_VERSION: ${{ needs.build_upload.outputs.version }}
PILOT_BUILD_NUMBER: ${{ needs.build_upload.outputs.build }}
PILOT_DISTRIBUTE_ONLY: true
steps:
- name: Check out repository
@ -79,26 +101,23 @@ jobs:
bundler-cache: true
- name: Publish on TestFlight (iOS)
run: |
export PILOT_APP_VERSION=`ci/version-number.sh ios`
export PILOT_BUILD_NUMBER=`ci/build-number.sh ios`
bundle exec fastlane --env ios,beta store_beta
bundle exec fastlane --env ios,beta run pilot
# - name: Publish on TestFlight (macOS)
# run: |
# export PILOT_APP_VERSION=`ci/version-number.sh mac`
# export PILOT_BUILD_NUMBER=`ci/build-number.sh mac`
# bundle exec fastlane --env mac,beta store_beta
# bundle exec fastlane --env mac,beta run pilot
- name: Tag beta
run: |
export VERSION=`ci/version-number.sh ios`
export BUILD=`ci/version-number.sh ios`
git tag "v$VERSION-b$BUILD" && git push --tags
git tag "v$PILOT_APP_VERSION-b$PILOT_BUILD_NUMBER" && git push --tags
submit_for_app_review:
name: Submit to App Review
runs-on: ubuntu-latest
needs: release_public_beta
needs: build_upload
environment:
name: app_review
env:
DELIVER_USERNAME: ${{ secrets.DELIVER_USERNAME }}
DELIVER_APP_VERSION: ${{ needs.build_upload.outputs.version }}
DELIVER_BUILD_NUMBER: ${{ needs.build_upload.outputs.build }}
DELIVER_FORCE: true
steps:
- name: Check out repository
@ -111,19 +130,18 @@ jobs:
bundler-cache: true
- name: Submit for App Review (iOS)
run: |
export DELIVER_APP_VERSION=`ci/version-number.sh ios`
export DELIVER_BUILD_NUMBER=`ci/build-number.sh ios`
bundle exec fastlane --env ios store_review add_id_info_uses_idfa:false
bundle exec fastlane --env ios deliver_review add_id_info_uses_idfa:false
- name: Submit for App Review (macOS)
run: |
export DELIVER_APP_VERSION=`ci/version-number.sh mac`
export DELIVER_BUILD_NUMBER=`ci/build-number.sh mac`
bundle exec fastlane --env mac store_review add_id_info_uses_idfa:false
release_to_app_store:
bundle exec fastlane --env mac deliver_review add_id_info_uses_idfa:false
publish_to_app_store:
name: Publish to App Store
runs-on: ubuntu-latest
needs: submit_for_app_review
environment:
name: app_store
env:
TAG_NAME: ${{ needs.build_upload.outputs.version }}
steps:
- name: Check out repository
uses: actions/checkout@v2
@ -139,14 +157,14 @@ jobs:
git_tag_gpgsign: true
git_push_gpgsign: false
- name: Tag release
id: tag_release
run: |
scripts/ci/commit-release.sh
git pull && git push && git push --tags
echo "::set-output name=tag_name::`git describe`"
git pull --no-tags origin $GITHUB_REF_NAME
git submodule update --recursive
scripts/ci/commit-release.sh $TAG_NAME
git push && git push --tags
- name: Assemble notes
run: |
export RELEASE_NOTES="release-notes.txt"
RELEASE_NOTES="release-notes.txt"
echo "# App Store" >$RELEASE_NOTES
echo >>$RELEASE_NOTES
echo "## iOS" >>$RELEASE_NOTES
@ -158,7 +176,7 @@ jobs:
- name: Publish release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag_release.outputs.tag_name }}
tag_name: "v${{ needs.build_upload.outputs.version }}"
body_path: release-notes.txt
files: |
release-notes.txt

View File

@ -8,29 +8,22 @@ on:
- '.beta-*'
- 'Passepartout.xcodeproj/project.pbxproj'
- '**/Info.plist'
- '**/CHANGELOG.md'
- '**/release_notes.txt'
env:
APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }}
FASTLANE_USERNAME: ${{ secrets.FASTLANE_USERNAME }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }}
MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }}
jobs:
run_tests:
name: Run tests
runs-on: macos-11
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Prepare build
uses: ./.github/actions/prepare-build-app
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Run tests
run: |
bundle exec fastlane --env mac,beta test_target
cd PassepartoutCore
swift test

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ default.profraw
asc-key.json
.bundle
vendor/
build/

View File

@ -17,16 +17,16 @@ GEM
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.532.0)
aws-sdk-core (3.122.1)
aws-partitions (1.537.0)
aws-sdk-core (3.124.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.51.0)
aws-sdk-kms (1.52.0)
aws-sdk-core (~> 3, >= 3.122.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.106.0)
aws-sdk-s3 (1.109.0)
aws-sdk-core (~> 3, >= 3.122.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
@ -280,4 +280,4 @@ DEPENDENCIES
fastlane-plugin-appcenter
BUNDLED WITH
2.2.15
2.2.22

View File

@ -51,6 +51,16 @@
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PassepartoutCoreTests"
BuildableName = "PassepartoutCoreTests"
BlueprintName = "PassepartoutCoreTests"
ReferencedContainer = "container:PassepartoutCore">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction

View File

@ -42,6 +42,16 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "PassepartoutCoreTests"
BuildableName = "PassepartoutCoreTests"
BlueprintName = "PassepartoutCoreTests"
ReferencedContainer = "container:PassepartoutCore">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction

View File

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Changed
- Release app in the open via [GitHub Actions](https://github.com/passepartoutvpn/passepartout-apple/actions).
## 1.17.2 (2021-11-30)
### Changed

View File

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Changed
- Release app in the open via [GitHub Actions](https://github.com/passepartoutvpn/passepartout-apple/actions).
### Fixed
- Last update was not refreshed on "Refresh infrastructure".

@ -1 +1 @@
Subproject commit 62305b8d915585bb8f7199c7a808eb7b57793339
Subproject commit dc63cbdabee12112adbf4b1cea2cbc2bee6ada57

View File

@ -6,7 +6,7 @@
[![License GPLv3](https://img.shields.io/badge/License-GPLv3-lightgray.svg)](LICENSE)
[![Unit Tests](https://github.com/passepartoutvpn/passepartout-apple/actions/workflows/test.yml/badge.svg)](https://github.com/passepartoutvpn/passepartout-apple/actions/workflows/test.yml)
[![Public Beta](https://github.com/passepartoutvpn/passepartout-apple/actions/workflows/beta.yml/badge.svg)](https://github.com/passepartoutvpn/passepartout-apple/actions/workflows/beta.yml)
[![Release](https://github.com/passepartoutvpn/passepartout-apple/actions/workflows/release.yml/badge.svg)](https://github.com/passepartoutvpn/passepartout-apple/actions/workflows/release.yml)
# [Passepartout][about-website]

@ -1 +1 @@
Subproject commit 657ed1691e0effe4569ad1fd2c99da9b25f1dda7
Subproject commit fe2794da2f515d352a708a6899cdf1ef2c229e4b

View File

@ -22,11 +22,6 @@ lane :preinstall_development_certs do
password: ENV["MATCH_KEYCHAIN_PASSWORD"]
)
match(
platform: "macos",
type: "development"
)
match(
platform: "ios",
type: "development"
)
end

View File

@ -10,8 +10,11 @@
# sdk "iphoneos9.0"
output_directory "dist/#{ENV["PLATFORM"]}"
clean true
silent false
skip_profile_detection true
disable_xcpretty true
build_path "build"
derived_data_path "build/derived_data"
#cloned_source_packages_path "build/sources"

View File

@ -4,8 +4,12 @@ if [[ $CURRENT_BRANCH != "master" ]]; then
echo "Not on master branch"
exit 1
fi
VERSION=$1
if [[ -z $VERSION ]]; then
echo "Must provide version"
exit 1
fi
VERSION=`ci/version-number.sh ios`
DATE=`date "+%Y-%m-%d"`
CHANGELOG_GLOB="Passepartout/App/*/CHANGELOG.md"
COMMIT_MESSAGE="[ci skip] Set release date"

View File

@ -6,11 +6,11 @@ if [[ $CURRENT_BRANCH != "master" ]]; then
fi
# set build number
. .env
MARKER_FILE=".beta-build"
BASE_BUILD_NUMBER=`cat .beta-base`
BUILD_FILE=".beta-build"
BUILD=$((BASE_BUILD_NUMBER + `git rev-list HEAD --count` + 1))
ci/set-build.sh $BUILD
echo $BUILD >$MARKER_FILE
echo $BUILD >$BUILD_FILE
# set release notes
ci/update-release-notes.sh ios &&
@ -23,7 +23,7 @@ git -C PassepartoutCore/Sources/PassepartoutCore/API pull origin master
git add */PassepartoutCore/API
# add build number
git add $MARKER_FILE
git add $BUILD_FILE
git add Passepartout.xcodeproj
git add *.plist

View File

@ -4,4 +4,5 @@ if [[ -z $PLATFORM ]]; then
echo "Platform required"
exit
fi
bundle exec fastlane --env $PLATFORM,beta,secret create_archive
export GYM_OUTPUT_DIRECTORY="dist/$PLATFORM"
bundle exec fastlane --env $PLATFORM,beta,secret test_and_build_app test:false

View File

@ -7,5 +7,5 @@ fi
export DELIVER_APP_VERSION=`ci/version-number.sh $PLATFORM`
export DELIVER_BUILD_NUMBER=`ci/build-number.sh $PLATFORM`
export DELIVER_FORCE="true"
bundle exec fastlane --env $PLATFORM,secret store_review add_id_info_uses_idfa:false
bundle exec fastlane --env $PLATFORM,secret deliver_review add_id_info_uses_idfa:false

View File

@ -4,10 +4,12 @@ if [[ -z $PLATFORM ]]; then
echo "Platform required"
exit
fi
OUTPUT_DIRECTORY="dist/$PLATFORM"
if [[ $PLATFORM == "ios" ]]; then
export PILOT_IPA="dist/ios/Passepartout.ipa"
export PILOT_IPA="$OUTPUT_DIRECTORY/Passepartout.ipa"
else
export PILOT_PKG="dist/mac/Passepartout.pkg"
export PILOT_PKG="$OUTPUT_DIRECTORY/Passepartout.pkg"
fi
export CHANGELOG_PREFACE=`cat templates/CHANGELOG.preface.md`
export PILOT_CHANGELOG=`ci/build-changelog.sh $PLATFORM`
bundle exec fastlane --env $PLATFORM,beta,secret store_beta
bundle exec fastlane --env $PLATFORM,beta,secret run pilot

7
scripts/local/test-app.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
PLATFORM=$1
if [[ -z $PLATFORM ]]; then
echo "Platform required"
exit
fi
bundle exec fastlane --env $PLATFORM,beta,secret test_and_build_app build:false