Skip to content

Commit 97f0f06

Browse files
committed
Attempt at auto-release
1 parent 1659c0b commit 97f0f06

File tree

1 file changed

+51
-3
lines changed

1 file changed

+51
-3
lines changed

.github/workflows/build.yml

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ jobs:
1212
build-linux:
1313
name: Build Linux
1414
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
1517
strategy:
1618
matrix:
1719
cxx: [g++-10, clang++-12]
1820
steps:
19-
- uses: actions/checkout@v1
21+
- uses: actions/checkout@v2
2022
- name: apt update
2123
run: sudo apt-get -o Acquire::Retries=3 update
2224
- name: install opengl
@@ -42,16 +44,34 @@ jobs:
4244
- name: install files
4345
run: make -C _build install
4446
- name: upload build artifacts
47+
if: github.ref == 'refs/heads/master'
4548
uses: actions/upload-artifact@v1
4649
with:
4750
name: Linux TreeSheets ${{ matrix.cxx }}
4851
path: TreeSheets-relocatable
52+
- name: zip
53+
if: github.ref == 'refs/heads/master'
54+
uses: vimtor/action-zip@v1
55+
with:
56+
files: TreeSheets-relocatable/
57+
dest: linux_treesheets_${{ matrix.cxx }}.zip
58+
- name: Create release
59+
if: github.ref == 'refs/heads/master'
60+
uses: ncipollo/release-action@v1
61+
with:
62+
tag: ${{ github.run_id }}
63+
allowUpdates: true
64+
omitBody: true
65+
commit: master
66+
artifacts: "linux_treesheets_${{ matrix.cxx }}.zip"
4967

5068
build-windows:
5169
name: Build Windows
5270
runs-on: windows-2022
71+
permissions:
72+
contents: write
5373
steps:
54-
- uses: actions/checkout@v1
74+
- uses: actions/checkout@v2
5575
- name: Add msbuild to PATH
5676
uses: microsoft/setup-msbuild@v1.0.3
5777
- name: clone wxWidgets
@@ -78,16 +98,28 @@ jobs:
7898
script-file: "TS_installer.nsi"
7999
arguments: "/V3"
80100
- name: upload build artifacts
101+
if: github.ref == 'refs/heads/master'
81102
uses: actions/upload-artifact@v1
82103
with:
83104
name: Windows TreeSheets (installer)
84105
path: Treesheets_Setup.exe
106+
- name: Create release
107+
if: github.ref == 'refs/heads/master'
108+
uses: ncipollo/release-action@v1
109+
with:
110+
tag: ${{ github.run_id }}
111+
allowUpdates: true
112+
omitBody: true
113+
commit: master
114+
artifacts: "Treesheets_Setup.exe"
85115

86116
build-mac:
87117
name: Build Mac
88118
runs-on: macos-latest
119+
permissions:
120+
contents: write
89121
steps:
90-
- uses: actions/checkout@v1
122+
- uses: actions/checkout@v2
91123
- name: clone wxWidgets
92124
run: git clone --depth 1 --recurse-submodules https://github.com/wxWidgets/wxWidgets
93125
- name: build wxWidgets
@@ -110,7 +142,23 @@ jobs:
110142
chmod +x build/Build/Products/Release/TreeSheets.app/Contents/MacOS/TreeSheets
111143
rm -rf build/Build/Products/Release/TreeSheets.app.dSYM
112144
- name: upload build artifacts
145+
if: github.ref == 'refs/heads/master'
113146
uses: actions/upload-artifact@v2
114147
with:
115148
name: Mac TreeSheets
116149
path: osx/TreeSheets/build/Build/Products/Release
150+
- name: zip
151+
if: github.ref == 'refs/heads/master'
152+
uses: vimtor/action-zip@v1
153+
with:
154+
files: osx/TreeSheets/build/Build/Products/Release/
155+
dest: mac_treesheets.zip
156+
- name: Create release
157+
if: github.ref == 'refs/heads/master'
158+
uses: ncipollo/release-action@v1
159+
with:
160+
tag: ${{ github.run_id }}
161+
allowUpdates: true
162+
omitBody: true
163+
commit: master
164+
artifacts: "mac_treesheets.zip"

0 commit comments

Comments
 (0)