Skip to content

Commit

Permalink
fix spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
ameknite committed Sep 22, 2023
1 parent 44148b5 commit 3152b23
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Release
env:
# If your repo name differs from your binary name, change it.
# Check you Cargo.toml -> package -> name
binary: ${{ github.event.repository.name }}
binary: ${{ github.event.repository.name }}

# Build platforms
# Valid platforms: web(wasm), linux, windows, macos(intel,apple)
Expand All @@ -13,7 +13,7 @@ env:
# Releases
# Valid platforms: releases(github_releases), itchio, pages(github_pages)
publish_to: "github_releases, itchio, github_pages"

# Itch.io configuration
# itchio_target is REQUIRED for publish to itch.io to work.
itchio_target: #<user>/<your-game>
Expand All @@ -30,17 +30,17 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'Add tag version: (e.g. -> v3.6.1)'
description: "Add tag version: (e.g. -> v3.6.1)"
required: true
type: string
build_for:
description: 'Build for:'
description: "Build for:"
default: web,linux,windows,macos
publish_to:
description: 'Publish to:'
description: "Publish to:"
default: releases,itchio,pages
itchio_target:
description: 'Itchio target: <user>/<your-game>'
description: "Itchio target: <user>/<your-game>"
type: string

jobs:
Expand All @@ -51,16 +51,16 @@ jobs:
uses: olegtarasov/get-tag@v2.1.2

outputs:
run_build_web: ${{( inputs.tag && (contains(inputs.build_for, 'web') || contains(inputs.build_for, 'wasm')) ) || ( !inputs.tag && (contains(env.build_for, 'web') || contains(env.build_for, 'wasm')) ) }}
run_build_linux: ${{(inputs.tag && contains(inputs.build_for, 'linux')) || (!inputs.tag && contains(env.build_for, 'linux') )}}
run_build_windows: ${{( inputs.tag && contains(inputs.build_for, 'windows')) || (!inputs.tag && contains(env.build_for, 'windows') ) }}
run_build_macos_intel: ${{( inputs.tag && (contains(inputs.build_for, 'intel') || contains(inputs.build_for, 'macos')) ) || (!inputs.tag && (contains(env.build_for, 'intel') || contains(env.build_for, 'macos')) ) }}
run_build_macos_apple_silicon: ${{( inputs.tag && ( contains(inputs.build_for, 'apple') || contains(inputs.build_for, 'macos') )) || (!inputs.tag && (contains(env.build_for, 'apple') || contains(env.build_for, 'macos')) ) }}
run_publish_github_releases: ${{( inputs.tag && contains(inputs.publish_to, 'releases')) || (!inputs.tag && contains(env.publish_to, 'releases') ) }}
run_publish_itchio: ${{( inputs.tag && contains(inputs.publish_to, 'itchio')) || (!inputs.tag && contains(env.publish_to, 'itchio') ) }}
run_publish_github_pages: ${{( inputs.tag && contains(inputs.publish_to, 'pages')) || (!inputs.tag && contains(env.publish_to, 'pages') ) }}
run_build_web: ${{ ( inputs.tag && (contains(inputs.build_for, 'web') || contains(inputs.build_for, 'wasm')) ) || ( !inputs.tag && (contains(env.build_for, 'web') || contains(env.build_for, 'wasm')) ) }}
run_build_linux: ${{ (inputs.tag && contains(inputs.build_for, 'linux')) || (!inputs.tag && contains(env.build_for, 'linux') ) }}
run_build_windows: ${{ ( inputs.tag && contains(inputs.build_for, 'windows')) || (!inputs.tag && contains(env.build_for, 'windows') ) }}
run_build_macos_intel: ${{ ( inputs.tag && (contains(inputs.build_for, 'intel') || contains(inputs.build_for, 'macos')) ) || (!inputs.tag && (contains(env.build_for, 'intel') || contains(env.build_for, 'macos')) ) }}
run_build_macos_apple_silicon: ${{ ( inputs.tag && ( contains(inputs.build_for, 'apple') || contains(inputs.build_for, 'macos') )) || (!inputs.tag && (contains(env.build_for, 'apple') || contains(env.build_for, 'macos')) ) }}
run_publish_github_releases: ${{ ( inputs.tag && contains(inputs.publish_to, 'releases')) || (!inputs.tag && contains(env.publish_to, 'releases') ) }}
run_publish_itchio: ${{ ( inputs.tag && contains(inputs.publish_to, 'itchio')) || (!inputs.tag && contains(env.publish_to, 'itchio') ) }}
run_publish_github_pages: ${{ ( inputs.tag && contains(inputs.publish_to, 'pages')) || (!inputs.tag && contains(env.publish_to, 'pages') ) }}
itchio_target: ${{ inputs.itchio_target || env.itchio_target }}
tag: ${{( inputs.tag || steps.get_version.outcome.tag )}}
tag: ${{ ( inputs.tag || steps.get_version.outcome.tag ) }}

# Build for Web Wasm
build-web:
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
- name: Package as a zip
working-directory: ./wasm
run: |
zip --recurse-paths ../${{env.binary}}_${{ needs.load-env.outputs.tag }}_web.zip .
zip --recurse-paths ../${{ env.binary }}_${{ needs.load-env.outputs.tag }}_web.zip .
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -196,12 +196,12 @@ jobs:
mkdir -p ${{ env.binary }}.app/Contents/MacOS
cp target/x86_64-apple-darwin/release/${{ env.binary}} ${{ env.binary }}.app/Contents/MacOS/
cp -r assets ${{ env.binary }}.app/Contents/MacOS/
hdiutil create -fs HFS+ -volname "${{ env.binary}}" -srcfolder ${{ env.binary }}.app ${{ env.binary}}_${{ needs.load-env.outputs.tag }}_macos_intel.dmg
hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary}}_${{ needs.load-env.outputs.tag }}_macos_intel.dmg
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v3
with:
path: ${{env.binary}}_${{ needs.load-env.outputs.tag }}_macos_intel.dmg
path: ${{ env.binary }}_${{ needs.load-env.outputs.tag }}_macos_intel.dmg
name: macos_intel
retention-days: 1

Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
mkdir -p ${{ env.binary }}.app/Contents/MacOS
cp target/aarch64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/
cp -r assets ${{ env.binary }}.app/Contents/MacOS/
hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{env.binary }}_${{ needs.load-env.outputs.tag }}_macos_apple_silicon.dmg
hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary }}_${{ needs.load-env.outputs.tag }}_macos_apple_silicon.dmg
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v3
Expand All @@ -243,10 +243,10 @@ jobs:
# Release binaries in github
publish-github-releases:
name: Release for ${{ matrix.artifact_name }}
needs:
needs:
- load-env
- build-web
- build-linux
- build-linux
- build-windows
- build-macos-apple-silicon
- build-macos-intel
Expand All @@ -266,12 +266,12 @@ jobs:
- artifact_name: macos_intel
os: macos-latest

runs-on: ${{matrix.os}}
steps:
runs-on: ${{ matrix.os }}
steps:
- uses: xSAVIKx/artifact-exists-action@v0
id: check_artifact
with:
name: ${{ matrix.artifact_name }}
name: ${{ matrix.artifact_name }}

# check for zip or dmg file
- uses: haya14busa/action-cond@v1
Expand All @@ -286,25 +286,25 @@ jobs:
if: steps.check_artifact.outputs.exists == 'true'
uses: actions/download-artifact@v3
with:
name: ${{matrix.artifact_name}}
name: ${{ matrix.artifact_name }}

- name: Upload artifact to release
if: steps.check_artifact.outputs.exists == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{env.binary}}_${{ needs.load-env.outputs.tag }}_${{ matrix.artifact_name }}.${{ steps.condval.outputs.value }}
file: ${{ env.binary}}_${{ needs.load-env.outputs.tag }}_${{ matrix.artifact_name }}.${{ steps.condval.outputs.value }}
asset_name: ${{ env.binary }}_${{ needs.load-env.outputs.tag }}_${{ matrix.artifact_name }}.${{ steps.condval.outputs.value }}
tag: ${{ needs.load-env.outputs.tag }}
overwrite: true

# Publish to itch.io
publish-itchio:
runs-on: ubuntu-latest
needs:
needs:
- load-env
- build-web
- build-linux
- build-linux
- build-windows
- build-macos-apple-silicon
- build-macos-intel
Expand All @@ -321,7 +321,7 @@ jobs:
unzip butler.zip
chmod +x butler
./butler -V
- uses: olegtarasov/get-tag@v2.1.2
id: get_version

Expand All @@ -340,7 +340,7 @@ jobs:
# Publish to github page
publish-github-pages:
runs-on: ubuntu-latest
needs:
needs:
- load-env
- build-web
if: ${{ needs.load-env.outputs.run_publish_github_pages == 'true' }}
Expand All @@ -361,4 +361,4 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: web
branch: gh-pages
branch: gh-pages

0 comments on commit 3152b23

Please sign in to comment.