-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
73 additions
and
16 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 |
---|---|---|
|
@@ -2,6 +2,9 @@ name: Publish CocoaPods package | |
on: | ||
release: | ||
types: [created] | ||
env: | ||
NODE_FILENAME: node-template-x86_64-apple-darwin.tar.gz | ||
NODE_BIN: node-template | ||
jobs: | ||
publish: | ||
runs-on: macOS-13 | ||
|
@@ -14,17 +17,38 @@ jobs: | |
run: sed -i '' "s|[[:blank:]]*s\.version[[:blank:]].*|s.version = '${VERSION}'|g" *.podspec | ||
env: | ||
VERSION: ${{ github.event.release.tag_name }} | ||
- name: Get node version | ||
id: node-version | ||
run: echo "VERSION=$(cat Tests/node-version.txt)" >> "$GITHUB_OUTPUT" | ||
- name: Download Substrate Node | ||
uses: dsaltares/[email protected] | ||
with: | ||
repo: 'substrate-developer-hub/substrate-node-template' | ||
version: 'tags/${{ steps.node-version.outputs.VERSION }}' | ||
file: ${{ env.NODE_FILENAME }} | ||
- name: Unpack Substrate Node | ||
run: tar -xvzf ${{ env.NODE_FILENAME }} | ||
- name: Update CocoaPods repo | ||
run: pod repo update | ||
- name: Publish Substrate Pod | ||
run: pod trunk push --allow-warnings --synchronous Substrate.podspec | ||
env: | ||
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | ||
- name: Publish RPC Pod | ||
run: pod trunk push --allow-warnings --synchronous Substrate-RPC.podspec | ||
env: | ||
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | ||
- name: Publish Keychain Pod | ||
run: pod trunk push --allow-warnings --synchronous Substrate-Keychain.podspec | ||
env: | ||
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | ||
- name: Publish RPC Pod | ||
env: | ||
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | ||
run: | | ||
Tests/with-node.sh './${{ env.NODE_BIN }}' \ | ||
'pod trunk push --allow-warnings --synchronous Substrate-RPC.podspec' \ | ||
'node_log.txt' | ||
- name: Upload node log | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test_node_full_log.txt | ||
path: node_log.txt | ||
|
||
|
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,7 +1,9 @@ | ||
name: Build & Tests | ||
on: [push, pull_request] | ||
env: | ||
SUBSTRATE_NODE_VERSION: 'v0.9.40' | ||
NODE_FILENAME_MAC: node-template-x86_64-apple-darwin.tar.gz | ||
NODE_FILENAME_LINUX: node-template-x86_64-unknown-linux-gnu.tar.gz | ||
NODE_BIN: node-template | ||
jobs: | ||
apple: | ||
strategy: | ||
|
@@ -20,27 +22,48 @@ jobs: | |
uses: actions/checkout@v3 | ||
- name: Select Xcode | ||
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.tests.xcode }}.app | ||
- name: Get node version | ||
id: node-version | ||
run: echo "VERSION=$(cat Tests/node-version.txt)" >> "$GITHUB_OUTPUT" | ||
- name: Download Substrate Node | ||
uses: dsaltares/[email protected] | ||
with: | ||
repo: 'substrate-developer-hub/substrate-node-template' | ||
version: 'tags/${{ env.SUBSTRATE_NODE_VERSION }}' | ||
file: 'node-template-x86_64-apple-darwin.tar.gz' | ||
version: 'tags/${{ steps.node-version.outputs.VERSION }}' | ||
file: ${{ env.NODE_FILENAME_MAC }} | ||
- name: Unpack Substrate Node | ||
run: tar -xvzf *.tar.gz | ||
run: tar -xvzf ${{ env.NODE_FILENAME_MAC }} | ||
- name: Build & Test SPM | ||
run: ./run_with_node.sh './node-template' 'xcrun swift test' 'node_log.txt' | ||
run: Tests/with-node.sh './${{env.NODE_BIN}}' 'xcrun swift test' 'node_log.txt' | ||
- name: Upload swift test node log | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: swift_test_node_full_log.txt | ||
path: node_log.txt | ||
- name: Cocoapods Repo Update | ||
run: pod repo update | ||
- name: Substrate Build & Test Cocoapods | ||
run: pod repo update && pod lib lint --allow-warnings --fail-fast Substrate.podspec | ||
run: | | ||
pod lib lint --allow-warnings --fail-fast Substrate.podspec | ||
# save podspec to env | ||
echo "LINTED_PODS=Substrate.podspec" >> "$GITHUB_ENV" | ||
- name: Keychain Build & Test Cocoapods | ||
run: pod lib lint --allow-warnings --fail-fast --include-podspecs=Substrate.podspec Substrate-Keychain.podspec | ||
run: | | ||
pod lib lint --allow-warnings --fail-fast \ | ||
--include-podspecs="{${LINTED_PODS}}" Substrate-Keychain.podspec | ||
# save podspec to env | ||
echo "LINTED_PODS=${LINTED_PODS},Substrate-Keychain.podspec" >> "$GITHUB_ENV" | ||
- name: RPC Build & Test Cocoapods | ||
run: pod lib lint --allow-warnings --fail-fast --include-podspecs=Substrate.podspec Substrate-RPC.podspec | ||
run: | | ||
Tests/with-node.sh './${{env.NODE_BIN}}' \ | ||
'pod lib lint --allow-warnings --fail-fast \ | ||
--include-podspecs="{${LINTED_PODS}}" Substrate-RPC.podspec' \ | ||
'cp_node_log.txt' | ||
- name: Upload swift test node log | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: cocoapods_node_full_log.txt | ||
path: cp_node_log.txt | ||
linux: | ||
strategy: | ||
matrix: | ||
|
@@ -55,16 +78,19 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Get node version | ||
id: node-version | ||
run: echo "VERSION=$(cat Tests/node-version.txt)" >> "$GITHUB_OUTPUT" | ||
- name: Download Substrate Node | ||
uses: dsaltares/[email protected] | ||
with: | ||
repo: 'substrate-developer-hub/substrate-node-template' | ||
version: 'tags/${{ env.SUBSTRATE_NODE_VERSION }}' | ||
file: 'node-template-x86_64-unknown-linux-gnu.tar.gz ' | ||
version: 'tags/${{ steps.node-version.outputs.VERSION }}' | ||
file: ${{ env.NODE_FILENAME_LINUX }} | ||
- name: Unpack Substrate Node | ||
run: tar -xvzf *.tar.gz | ||
run: tar -xvzf ${{ env.NODE_FILENAME_LINUX }} | ||
- name: Build and Test | ||
run: ./run_with_node.sh './node-template' 'swift test' 'node_log.txt' | ||
run: Tests/with-node.sh './${{env.NODE_BIN}}' 'swift test' 'node_log.txt' | ||
- name: Upload node log | ||
uses: actions/upload-artifact@v3 | ||
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
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 @@ | ||
v0.9.40 |
File renamed without changes.