Skip to content

Commit

Permalink
Merge pull request #26 from Slashlust/15-rodar-cd-e-gerar-release-qua…
Browse files Browse the repository at this point in the history
…ndo-houver-push-ou-pr-com-tag

15 rodar cd e gerar release quando houver push ou pr com tag
  • Loading branch information
LucasVinicius314 authored Sep 1, 2022
2 parents b4110ec + 4630e61 commit f52f08b
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Build project

on: [push, pull_request]
on:
pull_request:
branches:
- main
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
buildForAllSupportedPlatforms:
Expand All @@ -18,21 +24,52 @@ jobs:
- Android # Build an Android .apk standalone app.
# - WebGL # WebGL.
steps:
# Checkout
- uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true

# Cache
- uses: actions/cache@v2
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-

# Builder
- uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: ${{ matrix.targetPlatform }}

# Artifact upload
- uses: actions/upload-artifact@v2
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}

# Windows build zip
- uses: montudor/action-zip@v1
if: matrix.targetPlatform == 'StandaloneWindows64'
with:
args: zip -qq -r build/StandaloneWindows64.zip build/StandaloneWindows64

# Windows artifact release
- name: Release with Notes
uses: softprops/action-gh-release@v1
if: matrix.targetPlatform == 'StandaloneWindows64'
with:
files: build/StandaloneWindows64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Android artifact release
- name: Release with Notes
uses: softprops/action-gh-release@v1
if: matrix.targetPlatform == 'Android'
with:
files: build/Android/Android.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f52f08b

Please sign in to comment.