Rethink beta/release workflow

- Drop stable branch
    - Run tests on all branches except test/*
    - Publish beta manually
- Beta
    - Leave "Unreleased" in CHANGELOG
    - Add TestFlight URL
    - Tag beta after successful deployment
- Release
    - Enable GPG signing
    - Commit version and date in CHANGELOG
    - Tag release
    - Create GitHub release with merged notes

Show all workflows in README.
This commit is contained in:
Davide De Rosa 2021-11-30 11:27:05 +01:00
parent 6d74f06e97
commit 13896c7396
8 changed files with 61 additions and 39 deletions

View File

@ -1,9 +1,7 @@
name: Public Beta
on:
push:
branches:
- 'stable'
workflow_dispatch:
env:
APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }}
@ -61,6 +59,7 @@ jobs:
needs: [build_upload_ios, build_upload_mac]
environment:
name: public_beta
url: https://testflight.apple.com/join/K71mtLjZ
env:
PILOT_USERNAME: ${{ secrets.PILOT_USERNAME }}
PILOT_GROUPS: ${{ secrets.PILOT_GROUPS }}
@ -84,7 +83,7 @@ jobs:
# 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
- name: Tag release
- name: Tag beta
run: |
export VERSION=`ci/version-number.sh ios`
export BUILD=`ci/version-number.sh ios`
@ -116,3 +115,46 @@ jobs:
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:
runs-on: ubuntu-latest
needs: submit_for_app_review
environment:
name: app_store
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
submodules: true
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.GPG_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
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`"
- name: Assemble notes
run: |
export RELEASE_NOTES="release-notes.txt"
echo "# App Store" >$RELEASE_NOTES
echo >>$RELEASE_NOTES
echo "## iOS" >>$RELEASE_NOTES
echo >>$RELEASE_NOTES
cat Passepartout/App/iOS/fastlane/metadata/en-US/release_notes.txt >>$RELEASE_NOTES
echo "## macOS" >>$RELEASE_NOTES
echo >>$RELEASE_NOTES
cat Passepartout/App/macOS/fastlane/metadata/en-US/release_notes.txt >>$RELEASE_NOTES
- name: Publish release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag_release.outputs.tag_name }}
body_path: release-notes.txt
files: |
release-notes.txt

View File

@ -3,7 +3,7 @@ name: Unit Tests
on:
push:
branches-ignore:
- 'stable'
- 'test/*'
env:
APP_STORE_CONNECT_API_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY }}

View File

@ -4,7 +4,9 @@
![macOS 10.15+](https://img.shields.io/badge/macOS-10.15+-green.svg)
[![TunnelKit 4.0](https://img.shields.io/badge/TunnelKit-4.0-d69c68.svg)][dep-tunnelkit]
[![License GPLv3](https://img.shields.io/badge/License-GPLv3-lightgray.svg)](LICENSE)
[![GitHub Actions](https://github.com/passepartoutvpn/passepartout-apple/actions/workflows/beta.yml/badge.svg)](https://github.com/passepartoutvpn/passepartout-apple/actions/workflows/beta.yml)
[![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)
# [Passepartout][about-website]

@ -1 +1 @@
Subproject commit 26620d596ca3bbc25be6cc2efa2b52797021379a
Subproject commit 657ed1691e0effe4569ad1fd2c99da9b25f1dda7

View File

@ -1,4 +0,0 @@
#!/bin/sh
CHANGELOG_GLOB="Passepartout/App/*/CHANGELOG.md"
sed -i '' -E "s/^.*Beta.*$/## Unreleased/g" $CHANGELOG_GLOB

View File

@ -1,8 +1,8 @@
#!/bin/sh
#!/bin/bash
CURRENT_BRANCH=`git branch --show-current`
if [[ $CURRENT_BRANCH != "master" ]]; then
echo "Not on master branch"
exit
exit 1
fi
VERSION=`ci/version-number.sh ios`
@ -10,20 +10,16 @@ DATE=`date "+%Y-%m-%d"`
CHANGELOG_GLOB="Passepartout/App/*/CHANGELOG.md"
COMMIT_MESSAGE="[ci skip] Set release date"
TAG_MESSAGE="Release"
TAG_SIGN="--sign"
if [[ $1 == "no-sign" ]]; then
TAG_SIGN=""
fi
sed -i '' -E "s/^.*Beta.*$/## $VERSION ($DATE)/" $CHANGELOG_GLOB
sed -i'' -E "s/^.*Unreleased.*$/## $VERSION ($DATE)/" $CHANGELOG_GLOB
if ! git commit -am "$COMMIT_MESSAGE"; then
echo "Failed to commit release"
git reset --hard
exit
exit 1
fi
if ! git tag $TAG_SIGN -a "v$VERSION" -m "$TAG_MESSAGE"; then
if ! git tag -a "v$VERSION" -m "$TAG_MESSAGE"; then
echo "Failed to tag release"
git reset --hard HEAD^
exit
exit 1
fi

View File

@ -2,20 +2,17 @@
CURRENT_BRANCH=`git branch --show-current`
if [[ $CURRENT_BRANCH != "master" ]]; then
echo "Not on master branch"
exit
exit 1
fi
# just in case
scripts/after-beta.sh
# set build number
. .env
BUILD=$((BASE_BUILD_NUMBER + `git rev-list HEAD --count` + 1))
ci/set-build.sh $BUILD
# set release notes
ci/update-changelog.sh ios &&
ci/update-changelog.sh mac &&
ci/update-release-notes.sh ios &&
ci/update-release-notes.sh mac &&
ci/copy-release-notes.sh ios &&
ci/copy-release-notes.sh mac
@ -31,6 +28,6 @@ git add *.plist
git add Passepartout/App/*/CHANGELOG.md
git add Passepartout/App/*/fastlane/metadata/*/release_notes.txt
git commit -m "Set beta release"
git commit -m "Attempt beta release"
#VERSION=`ci/version-number.sh ios`
#git tag "v$VERSION-b$BUILD"

View File

@ -1,11 +0,0 @@
#!/bin/sh
CURRENT_BRANCH=`git branch --show-current`
if [[ $CURRENT_BRANCH != "master" ]]; then
echo "Not on master branch"
exit
fi
if !(git checkout stable && git merge master && git push github); then
echo "Error while pushing stable"
exit
fi
git checkout master