This repository has been archived by the owner on Mar 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
112 lines (110 loc) · 3.93 KB
/
CI.yaml
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
name: CI
on: [push]
jobs:
build:
name: Build LazyMan
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Cache Pods
id: cache-pods
uses: actions/cache@v1
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install Pods
run: pod install
- name: Choose Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '12.5.1'
- name: Install dpkg/ldid
run: brew install dpkg ldid
- name: Generate build number
uses: einaregilsson/build-number@v3
with:
token: ${{ secrets.github_token }}
- name: Build App
run: make archive
- name: Build Assets
run: make ipa deb
# upload-artifact@v2 should fix this hack
- name: Set Artifact Variables
id: artifact-variables
run: |
echo "::set-output name=ipa_name::$(basename $(find build/*.ipa))" >> artifacts
echo "::set-output name=ipa_path::$(find build/*.ipa)"
echo "::set-output name=deb_name::$(basename $(find build/*.deb))" >> artifacts
echo "::set-output name=deb_path::$(find build/*.deb)"
cat artifacts
- name: Upload Artifact (ipa)
uses: actions/upload-artifact@v1
with:
name: ${{ steps.artifact-variables.outputs.ipa_name }}
path: ${{ steps.artifact-variables.outputs.ipa_path }}
- name: Upload Artifact (deb)
uses: actions/upload-artifact@v1
with:
name: ${{ steps.artifact-variables.outputs.deb_name }}
path: ${{ steps.artifact-variables.outputs.deb_path }}
# A gross hack until we get wildcards for uploading/downloading artifacts
- name: Upload Artifact (artifact nanes)
uses: actions/upload-artifact@v1
with:
name: artifacts
path: artifacts
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download Artifact (names)
uses: actions/download-artifact@v1
with:
name: artifacts
path: artifacts
- name: Set Artifact Variables
id: artifact-variables
run: cat artifacts/artifacts
- name: Download Artifact (ipa)
uses: actions/download-artifact@v1
with:
name: ${{ steps.artifact-variables.outputs.ipa_name }}
path: ${{ steps.artifact-variables.outputs.ipa_name }}
- name: Download Artifact (deb)
uses: actions/download-artifact@v1
with:
name: ${{ steps.artifact-variables.outputs.deb_name }}
path: ${{ steps.artifact-variables.outputs.deb_name }}
- name: Create Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: (contains(github.ref, 'alpha') || contains(github.ref, 'beta'))
- name: Upload Release Asset (ipa)
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ steps.artifact-variables.outputs.ipa_name }}/${{ steps.artifact-variables.outputs.ipa_name }}
asset_name: ${{ steps.artifact-variables.outputs.ipa_name }}
asset_content_type: application/octet-stream
- name: Upload Release Asset (deb)
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{ steps.artifact-variables.outputs.deb_name }}/${{ steps.artifact-variables.outputs.deb_name }}
asset_name: ${{ steps.artifact-variables.outputs.deb_name }}
asset_content_type: application/octet-stream