-
Notifications
You must be signed in to change notification settings - Fork 30
127 lines (110 loc) · 4.8 KB
/
build-macos-x86_64.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Build Medict Tasks
on:
push:
# tags:
# - v*
branches:
- master
- develop
jobs:
package:
strategy:
matrix:
go-version: [1.21.x]
platform: [macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Get version tag (unix)
if: matrix.platform != 'windows-2019'
id: version
run: echo "::set-output name=tag::${GITHUB_SHA}"
- name: Inall pnpm
uses: pnpm/action-setup@v2
with:
version: 8.7.4
run_install: false
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Chechout
uses: actions/checkout@v2
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
# darwin
- name: Build for darwin
if: matrix.platform == 'macos-latest'
run: |
wails build -f -ldflags "-X main.Version=${{ steps.version.outputs.tag }}"
- name: Create darwin disk image
if: matrix.platform == 'macos-latest'
run: |
brew install create-dmg
ls -lh $PWD && ls -lh $PWD/build
create-dmg --volname "Medict" --volicon "build/assets/darwin/dmg_icon.icns" --background "build/assets/darwin/dmg_bg.png" --window-size 512 360 --icon-size 100 --icon "Medict.app" 100 185 --hide-extension "Medict.app" --app-drop-link 388 185 "Medict_${{ steps.version.outputs.tag }}_Darwin_x86_64.dmg" "build/bin"
- name: Upload darwin disk image
if: matrix.platform == 'macos-latest'
uses: actions/upload-artifact@v2
with:
name: Medict_${{ steps.version.outputs.tag }}_Darwin_x86_64.dmg
path: Medict_${{ steps.version.outputs.tag }}_Darwin_x86_64.dmg
release:
runs-on: ubuntu-latest
needs: package
steps:
- name: Get version tag
id: version
# run: echo "::set-output name=tag::${GITHUB_REF/refs\/tags\//}"
run: echo "::set-output name=tag::${GITHUB_SHA}"
- name: Get changelog url
id: changelog
run: echo "${{ steps.version.outputs.tag }}---$(date +'%Y-%m-%d')" | sed -e 's/\.//g' | awk '{print "::set-output name=url::https://github.com/terasum/medict/blob/develop/CHANGELOG.md#" $1}'
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.tag }}
release_name: ${{ steps.version.outputs.tag }}
body: Full changelog ⇒ [${{ steps.version.outputs.tag }}](${{ steps.changelog.outputs.url }})
draft: true
prerelease: false
- name: Download all release packages
uses: actions/download-artifact@v2
- name: Attach darwin disk image
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Medict_${{ steps.version.outputs.tag }}_Darwin_x86_64.dmg/Medict_${{ steps.version.outputs.tag }}_Darwin_x86_64.dmg
asset_name: Medict_${{ steps.version.outputs.tag }}_Darwin_x86_64.dmg
asset_content_type: application/octet-stream
# - name: Attach linux tar.gz
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: Medict_${{ steps.version.outputs.tag }}_Linux_x86_64.tar.gz/Medict_${{ steps.version.outputs.tag }}_Linux_x86_64.tar.gz
# asset_name: Medict_${{ steps.version.outputs.tag }}_Linux_x86_64.tar.gz
# asset_content_type: application/octet-stream
# - name: Attach linux app image
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: Wombat_${{ steps.version.outputs.tag }}_Linux_x86_64.AppImage/Wombat_${{ steps.version.outputs.tag }}_Linux_x86_64.AppImage
# asset_name: Wombat_${{ steps.version.outputs.tag }}_Linux_x86_64.AppImage
# asset_content_type: application/octet-stream
# - name: Attach windows zip
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: Medict_${{ steps.version.outputs.tag }}_Windows_x86_64.zip/Medict_${{ steps.version.outputs.tag }}_Windows_x86_64.zip
# asset_name: Medict_${{ steps.version.outputs.tag }}_Windows_x86_64.zip
# asset_content_type: application/octet-stream