-
Notifications
You must be signed in to change notification settings - Fork 2
117 lines (98 loc) · 3.49 KB
/
Copy pathrelease-app.yml
File metadata and controls
117 lines (98 loc) · 3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: release app
on:
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
release-ios:
runs-on: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Xcode Select Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.1.0'
- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
skipInvalidTags: true
noVersionBumpBehavior: "error"
majorList: "major, breaking"
token: ${{ env.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Bump version in Config.xcconfig
run: |
CURRENT_BUILD=$(grep BUILD_NUMBER ishare/Config.xcconfig | cut -d ' ' -f 3)
NEW_BUILD=$((CURRENT_BUILD + 1))
sed -i '' "s/BUILD_NUMBER = $CURRENT_BUILD/BUILD_NUMBER = $NEW_BUILD/" ishare/Config.xcconfig
CURRENT_VERSION=$(grep VERSION ishare/Config.xcconfig | cut -d ' ' -f 3)
NEW_VERSION=${{ steps.semver.outputs.nextStrict }}
sed -i '' "s/VERSION = $CURRENT_VERSION/VERSION = $NEW_VERSION/" ishare/Config.xcconfig
- name: Commit & Push changes
uses: EndBug/add-and-commit@v9
with:
add: 'ishare/Config.xcconfig'
default_author: github_actions
fetch: false
message: 'Bump version [skip ci]'
push: true
- name: Build Changelog
uses: dlavrenuek/conventional-changelog-action@v1.2.3
id: changelog
with:
from: ${{ steps.semver.outputs.current }}
to: HEAD
- name: Build iOS app
run: xcodebuild -scheme showdown -sdk iphoneos -configuration Release -derivedDataPath build -destination generic/platform=iOS CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
- name: Pack .ipa from .app
run: |
mkdir -p build/Build/Products/Release-iphoneos/Payload
mv build/Build/Products/Release-iphoneos/showdown.app build/Build/Products/Release-iphoneos/Payload/
cd build/Build/Products/Release-iphoneos
zip -r ../../../showdown.ipa Payload
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.semver.outputs.next }}
body_path: RELEASE.md
files: ./build/showdown.ipa
fail_on_unmatched_files: true
token: ${{ env.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
app-repo:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: release-ios
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 21
- name: Create app repo
run: |
npm install -g altstore-github
mkdir -p pages
npx altstore-github --config repo.json > app.json
mv {README.md,app.json} ../../pages/
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./pages
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4