Skip to content

Commit bcfb453

Browse files
committed
ci: Add support for github actions
1 parent b42c923 commit bcfb453

File tree

12 files changed

+233
-3
lines changed

12 files changed

+233
-3
lines changed

.github/workflows/build.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Build
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build-win-x64:
6+
runs-on: windows-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- uses: actions/setup-dotnet@v1
10+
with:
11+
dotnet-version: '3.1.x'
12+
- name: Build
13+
run: |
14+
cd VisualPinball.Engine.Mpf
15+
dotnet build -c Release -r win-x64
16+
# - name: Test
17+
# run: |
18+
# cd VisualPinball.Engine.Mpf.Test
19+
# dotnet run -c Release -r win-x64
20+
- run: |
21+
mkdir tmp
22+
xcopy /E /I VisualPinball.Engine.Mpf.Unity\Plugins\win-x64 tmp\win-x64
23+
- uses: actions/upload-artifact@v2
24+
with:
25+
name: Plugins
26+
path: tmp
27+
28+
build-win-x86:
29+
runs-on: windows-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
- uses: actions/setup-dotnet@v1
33+
with:
34+
dotnet-version: '3.1.x'
35+
- name: Build
36+
run: |
37+
cd VisualPinball.Engine.Mpf
38+
dotnet build -c Release -r win-x86
39+
# - name: Test
40+
# run: |
41+
# cd VisualPinball.Engine.Mpf.Test
42+
# dotnet run -c Release -r win-x86
43+
- run: |
44+
mkdir tmp
45+
xcopy /E /I VisualPinball.Engine.Mpf.Unity\Plugins\win-x86 tmp\win-x86
46+
- uses: actions/upload-artifact@v2
47+
with:
48+
name: Plugins
49+
path: tmp
50+
51+
build-osx-x64:
52+
runs-on: macos-latest
53+
steps:
54+
- uses: actions/checkout@v2
55+
- uses: actions/setup-dotnet@v1
56+
with:
57+
dotnet-version: '3.1.x'
58+
- name: Build
59+
run: |
60+
cd VisualPinball.Engine.Mpf
61+
dotnet build -c Release -r osx-x64
62+
# - name: Test
63+
# run: |
64+
# cd VisualPinball.Engine.Mpf.Test
65+
# dotnet run -c Release -r osx-x64
66+
- run: |
67+
mkdir tmp
68+
cp -r VisualPinball.Engine.Mpf.Unity/Plugins/osx-x64 tmp
69+
- uses: actions/upload-artifact@v2
70+
with:
71+
name: Plugins
72+
path: tmp
73+
74+
build-linux-x64:
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v2
78+
- uses: actions/setup-dotnet@v1
79+
with:
80+
dotnet-version: '3.1.x'
81+
- name: Build
82+
run: |
83+
cd VisualPinball.Engine.Mpf
84+
dotnet build -c Release -r linux-x64
85+
# - name: Test
86+
# run: |
87+
# cd VisualPinball.Engine.Mpf.Test
88+
# dotnet run -c Release -r linux-x64
89+
- run: |
90+
mkdir tmp
91+
cp -r VisualPinball.Engine.Mpf.Unity/Plugins/linux-x64 tmp
92+
- uses: actions/upload-artifact@v2
93+
with:
94+
name: Plugins
95+
path: tmp
96+
97+
dispatch:
98+
runs-on: ubuntu-latest
99+
needs: [ build-win-x64, build-win-x86, build-osx-x64, build-linux-x64 ]
100+
if: github.repository == 'VisualPinball/VisualPinball.Engine.Mpf' && github.ref == 'refs/heads/master' && github.event_name == 'push'
101+
steps:
102+
- uses: peter-evans/repository-dispatch@v1
103+
with:
104+
token: ${{ secrets.GH_PAT }}
105+
event-type: build-complete
106+
client-payload: '{"artifacts_run_id": "${{ github.run_id }}"}'

.github/workflows/publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Publish
2+
on:
3+
repository_dispatch:
4+
types: [ release-complete ]
5+
6+
jobs:
7+
registry:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: dawidd6/action-download-artifact@v2
12+
with:
13+
workflow: build
14+
run_id: ${{ github.event.client_payload.artifacts_run_id }}
15+
path: VisualPinball.Engine.Mpf.Unity
16+
- name: Publish
17+
run: |
18+
cd VisualPinball.Engine.Mpf.Unity
19+
echo "//registry.visualpinball.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
20+
npm publish
21+
env:
22+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Release
2+
on:
3+
repository_dispatch:
4+
types: [ build-complete ]
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
- name: Fetch next version
14+
id: nextVersion
15+
uses: VisualPinball/[email protected]
16+
with:
17+
path: VisualPinball.Engine.Mpf.Unity
18+
tagPrefix: 'v'
19+
- name: Bump
20+
if: ${{ steps.nextVersion.outputs.isBump == 'true' }}
21+
run: |
22+
cd VisualPinball.Engine.Mpf.Unity
23+
npm version ${{ steps.nextVersion.outputs.nextVersion }} --no-git-tag-version
24+
- name: Commit
25+
id: commit
26+
if: ${{ steps.nextVersion.outputs.isBump == 'true' }}
27+
run: |
28+
git config user.name "github-actions"
29+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
30+
git add VisualPinball.Engine.Mpf.Unity/package.json
31+
git commit -m "release: ${{ steps.nextVersion.outputs.nextTag }}."
32+
git push
33+
commitish=$(git rev-parse HEAD)
34+
echo ::set-output name=commitish::${commitish}
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
- name: Create Release
38+
uses: actions/create-release@v1
39+
with:
40+
tag_name: ${{ steps.nextVersion.outputs.nextTag }}
41+
release_name: ${{ steps.nextVersion.outputs.nextTag }}
42+
prerelease: ${{ steps.nextVersion.outputs.isPrerelease }}
43+
commitish: ${{ steps.commit.outputs.commitish }}
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
47+
dispatch:
48+
runs-on: ubuntu-latest
49+
needs: [ release ]
50+
steps:
51+
- uses: peter-evans/repository-dispatch@v1
52+
with:
53+
token: ${{ secrets.GH_PAT }}
54+
event-type: release-complete
55+
client-payload: '{"artifacts_run_id": "${{ github.event.client_payload.artifacts_run_id }}"}'
-1.12 MB
Binary file not shown.

VisualPinball.Engine.Mpf.Unity/Plugins/linux-x64/libgrpc_csharp_ext.so.meta

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-1.12 MB
Binary file not shown.
-7.98 MB
Binary file not shown.
-1.12 MB
Binary file not shown.
-9.1 MB
Binary file not shown.
-1.12 MB
Binary file not shown.

0 commit comments

Comments
 (0)