Skip to content

Commit 2387412

Browse files
committed
Add Project settings
1 parent c9e05ff commit 2387412

5 files changed

Lines changed: 95 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
build:
7+
runs-on: macos-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- name: setup JDK 1.8
11+
uses: actions/setup-java@v1
12+
with:
13+
java-version: 1.8
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: 10
17+
registry-url: "https://registry.npmjs.org"
18+
- name: Config Github Account
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
run: |
22+
git config user.email "pengfeizhou@foxmail.com"
23+
git config user.name "pengfei.zhou"
24+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
25+
git checkout main
26+
- name: Install Cocoapods
27+
run: |
28+
gem install cocoapods
29+
- name: Echo current Version
30+
run: |
31+
echo ${GITHUB_REF:11}>version
32+
echo "Current Version is "${GITHUB_REF:11}
33+
- name: Publish
34+
run: |
35+
sh publish.sh
36+
env:
37+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
39+
BINTARY_USER: ${{ secrets.BINTARY_USER }}
40+
BINTARY_REPO: ${{ secrets.BINTARY_REPO }}
41+
BINTARY_APIKEY: ${{ secrets.BINTARY_APIKEY }}

DoricPlatformAPI.podspec

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ Pod::Spec.new do |s|
55

66
#s.description = <<-DESC
77
# DESC
8-
9-
s.homepage = 'https://xxx'
8+
s.homepage = 'https://github.com/doric-pub/DoricPlatformAPI'
109
s.license = { :type => 'Apache-2.0', :file => 'LICENSE' }
11-
s.author = { 'xxx' => 'xxx@xxx' }
12-
s.source = { :git => 'git@xxx', :tag => s.version.to_s }
13-
10+
s.author = { 'pengfei.zhou' => 'pengfei.zhou@foxmail.com' }
11+
s.source = { :git => 'https://github.com/doric-pub/DoricPlatformAPI.git', :tag => s.version.to_s }
12+
1413
s.ios.deployment_target = '9.0'
1514

1615
s.source_files = 'iOS/Classes/**/*'

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DoricImagePicker
2+
Doric library for platform apis

android/pom.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name=DoricPlatformAPI
2+
groupId=pub.doric.extension
3+
artifactId=platform-api
4+
version=0.1.0

publish.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
##############################################################################
3+
##
4+
## Publish JS,Android,iOS
5+
##
6+
##############################################################################
7+
8+
CURRENT_DIR=$(cd $(dirname $0); pwd)
9+
CURRENT_VERSION=$(cat $CURRENT_DIR/version)
10+
11+
echo "Current version is "$CURRENT_VERSION
12+
13+
## iOS
14+
sed -i "" "s/\(version[ ]*= \)'[0-9 \.]*'/\1'$CURRENT_VERSION'/g" $CURRENT_DIR/DoricImagePicker.podspec
15+
16+
# git save
17+
cd $CURRENT_DIR/
18+
19+
echo "Commit changes"
20+
git add .
21+
git commit -m "Release v${CURRENT_VERSION}"
22+
23+
## JS
24+
cd $CURRENT_DIR && npm version $CURRENT_VERSION --allow-same-version
25+
26+
git tag ${CURRENT_VERSION}
27+
28+
git push
29+
30+
git push --tags
31+
32+
npm install doric-cli -g
33+
34+
npm install
35+
36+
cd example && npm install && cd ..
37+
38+
39+
echo "Publish JS"
40+
cd $CURRENT_DIR/ && npm publish
41+
echo "Publish Android"
42+
cd $CURRENT_DIR/example/android && ./gradlew clean :lib:uploadArchives
43+
echo "Publish iOS"
44+
cd $CURRENT_DIR && pod trunk push DoricPlatformAPI.podspec --allow-warnings

0 commit comments

Comments
 (0)