-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 1.76 KB
/
release.yml
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
name: Release
on:
push:
tags: '[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Generate Release Note
run: |
wget ${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases\?per_page\=1 -O releases.json
cat releases.json | jq
LATEST_TAG=`cat releases.json | jq -r '.[0].tag_name'`
NEXT_TAG=`echo ${GITHUB_REF} | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+'`
echo "## Commits from ${NEXT_TAG} to ${LATEST_TAG}" | tee release_note.md
git log --pretty="%h - %s" ${LATEST_TAG}..${NEXT_TAG} | tee -a release_note.md
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Setup
run: ./.github/workflows/setup.sh
- name: Build
run: xcodebuild clean -scheme 'Notch Sim' build -configuration Release -derivedDataPath build
- name: Zip the build
run: |
cd build/Build/Products/Release/
zip -r NotchSim.app.zip 'Notch Sim.app'
- name: Create a Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: release_note.md
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/Build/Products/Release/NotchSim.app.zip
asset_name: NotchSim.app.zip
asset_content_type: application/zip