-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* try using script for iap stub * typo * typo * typo * removed working dir * added comment to stub_iap.sh * checkout first * increment build number by script * Update increment_build_number.sh * fixed iap repo * stub
- Loading branch information
Showing
7 changed files
with
41 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export newVersion="$1" | ||
|
||
if [[ -n "$newVersion" ]]; then | ||
#https://stackoverflow.com/a/30214769/13167574 | ||
perl -i -pe 's/^(version:\s+)(\d+\.\d+\.\d+)(\+)(\d+)$/$1.$ENV{'newVersion'}.$3.($4+1)/e' pubspec.yaml | ||
else | ||
echo "argument error" | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# https://unix.stackexchange.com/questions/435708/regex-multiline-pattern-and-substitution-replacement | ||
perl -0777 -i -pe 's/( m3_lightmeter_iap:\n)( git:\n url: "https:\/\/github.com\/vodemn\/m3_lightmeter_iap"\n ref: main)/$1 path: iap/sg' pubspec.yaml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,10 @@ jobs: | |
runs-on: macos-11 | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Connect private iap package | ||
uses: webfactory/[email protected] | ||
if: ${{ inputs.include-iap }} | ||
|
@@ -35,13 +39,8 @@ jobs: | |
|
||
- name: Override iap package with stub | ||
if: ${{ !inputs.include-iap }} | ||
run: | | ||
echo "\ndependency_overrides:\n m3_lightmeter_iap:\n path: iap" >> pubspec.yaml | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
run: bash ./.github/scripts/stub_iap.sh | ||
|
||
- uses: actions/setup-java@v2 | ||
with: | ||
distribution: "zulu" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,10 @@ jobs: | |
runs-on: macos-11 | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Connect private iap package | ||
uses: webfactory/[email protected] | ||
if: ${{ inputs.include-iap }} | ||
|
@@ -54,12 +58,7 @@ jobs: | |
|
||
- name: Override iap package with stub | ||
if: ${{ !inputs.include-iap }} | ||
run: | | ||
echo "\ndependency_overrides:\n m3_lightmeter_iap:\n path: iap" >> pubspec.yaml | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
run: bash ./.github/scripts/stub_iap.sh | ||
|
||
- uses: actions/setup-java@v3 | ||
with: | ||
|
@@ -98,7 +97,7 @@ jobs: | |
# Therefore here we have to increment it as well to build an apk with the same build number. | ||
- name: Increment build number & replace version number | ||
if: ${{ inputs.github-release }} | ||
run: perl -i -pe 's/^(version:\s+)(\d+\.\d+\.\d+)(\+)(\d+)$/$1."${{ github.event.inputs.version }}".$3.($4+1)/e' pubspec.yaml | ||
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }} | ||
|
||
- name: Install Flutter | ||
uses: subosito/flutter-action@v2 | ||
|
@@ -160,7 +159,7 @@ jobs: | |
submodules: recursive | ||
|
||
- name: Increment build number & replace version number | ||
run: perl -i -pe 's/^(version:\s+)(\d+\.\d+\.\d+)(\+)(\d+)$/$1."${{ github.event.inputs.version }}".$3.($4+1)/e' pubspec.yaml | ||
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }} | ||
|
||
- name: Commit changes | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,30 +11,25 @@ on: | |
pull_request: | ||
branches: ["main"] | ||
|
||
env: | ||
# Stub iap package if this worlflow is running from the PR from a fork | ||
STUB_IAP: ${{ github.event.pull_request.head.repo.full_name != github.repository }} | ||
|
||
jobs: | ||
analyze_and_test: | ||
name: Analyze & test | ||
runs-on: macos-11 | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Connect private iap package | ||
uses: webfactory/[email protected] | ||
if: !env.STUB_IAP | ||
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | ||
with: | ||
ssh-private-key: ${{ secrets.M3_LIGHTMETER_IAP_KEY }} | ||
|
||
- name: Override iap package with stub | ||
if: env.STUB_IAP | ||
run: | | ||
echo "\ndependency_overrides:\n m3_lightmeter_iap:\n path: iap" >> pubspec.yaml | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} | ||
run: bash ./.github/scripts/stub_iap.sh | ||
|
||
- uses: subosito/flutter-action@v2 | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
enum IAPProductStatus { | ||
purchasable, | ||
pending, | ||
purchased, | ||
} | ||
|
||
enum IAPProductType { paidFeatures } | ||
|
||
class IAPProduct { | ||
IAPProduct(); | ||
abstract class IAPProduct { | ||
const IAPProduct._(); | ||
|
||
IAPProductStatus get status => IAPProductStatus.purchasable; | ||
} |
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