Skip to content

Try cache with branch filter #35

Try cache with branch filter

Try cache with branch filter #35

Workflow file for this run

name: Release to itch.io
on:
push:
branches:
- main
tags:
- 'v*'
env:
ITCH_USER_NAME: apos
ITCH_GAME_NAME: mitten
PROJECT_PATH: Platforms/DesktopGL
jobs:
build:
runs-on: ubuntu-20.04
env:
MGFXC_WINE_PATH: /home/runner/.winemonogame
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Get version from tag
run: |
TAGVERSION=$(git describe --tags --abbrev=0)
echo "TAGVERSION=${TAGVERSION:1}" >> $GITHUB_ENV
- name: Restore cached wine
id: cache-wine-restore
uses: actions/cache/restore@v3
with:
path: |
/home/runner/.winemonogame
key: ${{ runner.os }}-wine
- name: Setup Wine
if: steps.cache-wine-restore.outputs.cache-hit != 'true'
run: |
sudo apt update
sudo apt install wine64 p7zip-full
wget -qO- https://raw.githubusercontent.com/MonoGame/MonoGame/develop/Tools/MonoGame.Effect.Compiler/mgfxc_wine_setup.sh | sh
- name: Build Windows
run: dotnet publish ${{ env.PROJECT_PATH }} -r win-x64 -c Release --output artifacts/windows --self-contained -p:Version=${{ env.TAGVERSION }}
- name: Build Osx
run: dotnet publish ${{ env.PROJECT_PATH }} -r osx-x64 -c Release --output artifacts/osx --self-contained -p:Version=${{ env.TAGVERSION }}
- name: Build Linux
run: dotnet publish ${{ env.PROJECT_PATH }} -r linux-x64 -c Release --output artifacts/linux --self-contained -p:Version=${{ env.TAGVERSION }}
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Publish Windows build to itch.io
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_API_KEY }}
CHANNEL: windows
ITCH_GAME: ${{ env.ITCH_GAME_NAME }}
ITCH_USER: ${{ env.ITCH_USER_NAME }}
PACKAGE: artifacts/windows
VERSION: ${{ env.TAGVERSION }}
- name: Publish OSX build to itch.io
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_API_KEY }}
CHANNEL: osx
ITCH_GAME: ${{ env.ITCH_GAME_NAME }}
ITCH_USER: ${{ env.ITCH_USER_NAME }}
PACKAGE: artifacts/osx
VERSION: ${{ env.TAGVERSION }}
- name: Publish Linux build to itch.io
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_API_KEY }}
CHANNEL: linux
ITCH_GAME: ${{ env.ITCH_GAME_NAME }}
ITCH_USER: ${{ env.ITCH_USER_NAME }}
PACKAGE: artifacts/linux
VERSION: ${{ env.TAGVERSION }}
- name: Save wine
id: cache-wine-save
uses: actions/cache/save@v3
with:
path: |
/home/runner/.winemonogame
key: ${{ steps.cache-wine-restore.outputs.cache-primary-key }}