Skip to content

Commit 61ce070

Browse files
committed
Merge branch 'master' of https://github.com/mac-cain13/R.swift
2 parents ee93414 + dcab112 commit 61ce070

File tree

13 files changed

+162
-1133
lines changed

13 files changed

+162
-1133
lines changed

.github/workflows/checks.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Checks
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: '*'
8+
9+
env:
10+
DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
11+
12+
jobs:
13+
unit-tests:
14+
runs-on: macos-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- name: Pull cache
19+
uses: actions/cache@v1
20+
with:
21+
path: .build
22+
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
23+
restore-keys: |
24+
${{ runner.os }}-spm-
25+
- name: Test
26+
run: swift test -v
27+
28+
test-iOS:
29+
runs-on: macos-latest
30+
needs: build
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v2
34+
- name: Download build
35+
uses: actions/download-artifact@v1
36+
with:
37+
name: rswift-dev
38+
- name: Put build into place
39+
run: |
40+
mkdir -p build/Debug
41+
mv rswift-dev/rswift build/Debug/rswift
42+
chmod +x build/Debug/rswift
43+
- name: Pull cache
44+
uses: actions/cache@v1
45+
id: pod-cache
46+
with:
47+
path: Pods
48+
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
49+
restore-keys: |
50+
${{ runner.os }}-pods-
51+
- name: Install pods
52+
if: steps.pod-cache.outputs.cache-hit != 'true'
53+
run: pod install
54+
- name: Test
55+
run: fastlane scan --workspace "ResourceApp.xcworkspace" --scheme "ResourceApp"
56+
57+
test-tvOS:
58+
runs-on: macos-latest
59+
needs: build
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v2
63+
- name: Download build
64+
uses: actions/download-artifact@v1
65+
with:
66+
name: rswift-dev
67+
- name: Put build into place
68+
run: |
69+
mkdir -p build/Debug
70+
mv rswift-dev/rswift build/Debug/rswift
71+
chmod +x build/Debug/rswift
72+
- name: Pull cache
73+
uses: actions/cache@v1
74+
id: pod-cache
75+
with:
76+
path: Pods
77+
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
78+
restore-keys: |
79+
${{ runner.os }}-pods-
80+
- name: Install pods
81+
if: steps.pod-cache.outputs.cache-hit != 'true'
82+
run: pod install
83+
- name: Test
84+
run: fastlane scan --workspace "ResourceApp.xcworkspace" --scheme "ResourceApp-tvOS"
85+
86+
build:
87+
runs-on: macos-latest
88+
steps:
89+
- name: Checkout
90+
uses: actions/checkout@v2
91+
- name: Pull cache
92+
uses: actions/cache@v1
93+
with:
94+
path: .build
95+
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
96+
restore-keys: |
97+
${{ runner.os }}-spm-
98+
- name: Set version
99+
run: |
100+
sed -i "" "s/\(static let version = \"\)Unknown\(\"\)/\1Development build: ${GITHUB_SHA}\2/" Sources/rswift/Rswift.swift
101+
- name: Build
102+
run: swift build -v -c release
103+
- name: Store artifact
104+
uses: actions/upload-artifact@v1
105+
with:
106+
name: rswift-dev
107+
path: .build/release/rswift

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: created
6+
7+
env:
8+
DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
9+
10+
jobs:
11+
release-build:
12+
runs-on: macos-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Set version
18+
run: |
19+
sed -i "" "s/\(static let version = \"\).*\(\"\)/\1${TAG}\2/" Sources/rswift/Rswift.swift
20+
env:
21+
TAG: ${{ github.event.release.tag_name }}
22+
23+
- name: Build
24+
run: swift build -v -c release
25+
- name: Archive
26+
run: zip --junk-paths ${{ runner.temp }}/archive.zip .build/release/rswift License
27+
- name: Upload
28+
uses: actions/upload-release-asset@v1
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
with:
32+
upload_url: ${{ github.event.release.upload_url }}
33+
asset_path: ${{ runner.temp }}/archive.zip
34+
asset_name: rswift-${{ github.event.release.tag_name }}.zip
35+
asset_content_type: application/zip
36+
37+
- name: Store artifact
38+
uses: actions/upload-artifact@v1
39+
with:
40+
name: rswift-${{ github.event.release.tag_name }}
41+
path: .build/release/rswift
42+
43+
- name: Publish to Cocoapods
44+
run: |
45+
export POD_VERSION=$(echo $TAG_NAME | cut -c2-)
46+
pod trunk push
47+
env:
48+
TAG_NAME: ${{ github.event.release.tag_name }}
49+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

0 commit comments

Comments
 (0)