Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: release macos #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: CI
on:
push:
branches:
- master
on: [push]

jobs:
deploy:
runs-on: macos-latest
Expand All @@ -21,8 +19,15 @@ jobs:
with:
flutter-version: "1.26.0-1.0.pre"
channel: "dev"
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Install tools
run: |
brew update
brew install yq
GO111MODULE=on go get -u -a github.com/go-flutter-desktop/hover
flutter pub get
flutter build ios --release --no-codesign
cd ./ios && pod install
Expand All @@ -42,10 +47,11 @@ jobs:
PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Deploy to TestFlight
run: |
make build-macos
cd ./ios
bundle exec fastlane match development --readonly
security find-identity -v -p codesigning
bundle exec fastlane beta --verbose
bundle exec fastlane mac release -- verbose
env:
TEAM_ID: ${{ secrets.TEAM_ID }}
ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ ios/*.zip
artifacts
ios/*.ipa
.flutter-plugins-dependencies
ios/fastlane/report.xml
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
NAME = $(shell yq e '.name' pubspec.yaml)
VERSION = $(shell yq e '.version' pubspec.yaml)

CERT_NAME := LNCQ7FYZE7
APPLE_USERNAME := [email protected]
APPLE_PASSWORD := @keychain:AC_PASSWORD
CERT_NAME := Developer ID Application: 0x2A Ltd (LNCQ7FYZE7)

GOMOBILE_PKG := nimona.io/plugins/flutter
APP_PATH := $(CURDIR)
Expand Down Expand Up @@ -63,8 +61,8 @@ release-ios:
.PHONE: release-ios-verify
release-ios-verify:
@xcrun altool \
--username "$(APPLE_USERNAME)" \
--password "$(APPLE_PASSWORD)" \
--username "$(FASTLANE_USER)" \
--password "$(FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD)" \
--notarization-info $(REQ_ID)

.PHONY: build-macos
Expand Down Expand Up @@ -92,7 +90,7 @@ build-macos:
@xcrun altool \
--notarize-app \
--primary-bundle-id "io.nimona.$(NAME)" \
--username "$(APPLE_USERNAME)" \
--password "$(APPLE_PASSWORD)" \
--username "$(FASTLANE_USER)" \
--password "$(FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD)" \
--file ./artifacts/$(NAME)-$(VERSION).app.zip
@echo "All done!"
2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (

// replace github.com/zserge/metric => ../../metric

replace nimona.io => ../../../../nimona.io
// replace nimona.io => ../../../../nimona.io

// replace github.com/go-flutter-desktop/go-flutter => ../../go-flutter

Expand Down
12 changes: 12 additions & 0 deletions go/packaging/darwin-pkg/flat/Distribution.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<title>{{.applicationName}}</title>
<background alignment="topleft" file="root/Applications/{{.applicationName}}.app/Contents/MacOS/assets/icon.png"/>
<choices-outline>
<line choice="choiceBase"/>
</choices-outline>
<choice id="choiceBase" title="base">
<pkg-ref id="{{.organizationName}}.base.pkg"/>
</choice>
<pkg-ref id="{{.organizationName}}.base.pkg" version="{{.version}}" auth="Root">#base.pkg</pkg-ref>
</installer-gui-script>
5 changes: 5 additions & 0 deletions go/packaging/darwin-pkg/flat/base.pkg/PackageInfo.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<pkg-info format-version="2" identifier="{{.organizationName}}.base.pkg" version="{{.version}}" install-location="/" auth="root">
<bundle-version>
<bundle id="{{.organizationName}}" CFBundleIdentifier="{{.organizationName}}.{{.packageName}}" path="./Applications/{{.applicationName}}.app" CFBundleVersion="{{.version}}"/>
</bundle-version>
</pkg-info>
11 changes: 4 additions & 7 deletions ios/fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
app_identifier("io.nimona.identity") # The bundle identifier of your app
apple_id("[email protected]") # Your Apple email address
app_identifier("io.nimona.identity")
apple_id("[email protected]")

itc_team_id("120343054") # App Store Connect Team ID
team_id("LNCQ7FYZE7") # Developer Portal Team ID

# For more information about the Appfile, see:
# https://docs.fastlane.tools/advanced/#appfile
itc_team_id("120343054")
team_id("LNCQ7FYZE7")
26 changes: 26 additions & 0 deletions ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,30 @@ platform :ios do
)
upload_to_testflight
end
end
platform :mac do
desc "Push a new build to macos store"
lane :release do
# setup_ci
# sync_code_signing(
# type: "appstore",
# readonly: is_ci
# )
# build_app(
# workspace: "Runner.xcworkspace",
# scheme: "Runner",
# )
app_store_connect_api_key(
key_id: ENV["APPSTORE_CONNECT_KEYID"],
issuer_id: ENV["APPSTORE_CONNECT_ISSUERID"],
key_content: ENV["APPSTORE_CONNECT_PRIVATE_KEY"]
)
notarize(
verbose: true,
package: "../go/build/outputs/darwin-bundle-release/identity 1.7.0.app",
bundle_id: "io.nimona.identity",
asc_provider: ENV["ITC_TEAM_ID"] # "LNCQ7FYZE7"
)
# upload_to_testflight
end
end
9 changes: 9 additions & 0 deletions ios/fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ Push a new beta build to TestFlight

----

## Mac
### mac release
```
fastlane mac release
```
Push a new build to macos store

----

This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).