Skip to content

Create Release

Create Release #8

name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version number.'
required: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
# Download BepInEx
- run: echo "::set-output name=URL::$(curl -vs https://builds.bepinex.dev/projects/bepinex_be 2>&1 | grep -Po '(?<=href=")(\/projects\/bepinex_be\/(.*)\/BepInEx-Unity.IL2CPP-win-x64(.*))(?=")' | head -1)"
id: bepinexurl
- run: wget https://builds.bepinex.dev${{ steps.bepinexurl.outputs.URL}}
- run: dotnet build -c Release -o build
# Normal artifact
- run: mkdir -p ${{ github.event.repository.name }}/reg/BepInEx/plugins; mkdir -p ${{ github.event.repository.name }}/reg/BepInEx/config
- run: cp build/${{ github.event.repository.name }}.dll ${{ github.event.repository.name }}/reg/BepInEx/plugins/${{ github.event.repository.name }}.dll
- run: unzip BepInEx-Unity.IL2CPP-win-x64* -d ${{ github.event.repository.name }}/reg
- run: chmod -R 775 ${{ github.event.repository.name }}/reg
- run: cp .github/workflows/BepInEx.cfg ${{ github.event.repository.name }}/reg/BepInEx/config
- run: cp .github/workflows/doorstop_config.ini ${{ github.event.repository.name }}/reg/
- run: touch ${{ github.event.repository.name }}/reg/EXTRACT_TO_GAME_DIRECTORY
- run: cd ${{ github.event.repository.name }}/reg; zip -r ../../${{ github.event.repository.name }}_${{ github.event.inputs.version }}.zip ./*
# Ubi+ artifact
- run: mkdir -p ${{ github.event.repository.name }}/ubi/BepInEx/plugins; mkdir -p ${{ github.event.repository.name }}/ubi/BepInEx/config
- run: cp build/${{ github.event.repository.name }}.dll ${{ github.event.repository.name }}/ubi/BepInEx/plugins/${{ github.event.repository.name }}.dll
- run: unzip .github/workflows/ubiplus_BepInEx-Unity.IL2CPP-win-x64* -d ${{ github.event.repository.name }}/ubi
- run: chmod -R 775 ${{ github.event.repository.name }}/ubi
- run: cp .github/workflows/BepInEx.cfg ${{ github.event.repository.name }}/ubi/BepInEx/config
- run: cp .github/workflows/doorstop_config.ini ${{ github.event.repository.name }}/ubi/
- run: touch ${{ github.event.repository.name }}/ubi/EXTRACT_TO_GAME_DIRECTORY
- run: cd ${{ github.event.repository.name }}/ubi; zip -r ../../${{ github.event.repository.name }}_${{ github.event.inputs.version }}_UbisoftPlus.zip ./*
# Create release
- uses: ncipollo/release-action@v1
with:
artifacts: "${{ github.event.repository.name }}_${{ github.event.inputs.version }}.zip, ${{ github.event.repository.name }}_${{ github.event.inputs.version }}_UbisoftPlus.zip"
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.inputs.version }}
name: "${{ github.event.inputs.version }}"
draft: true
generateReleaseNotes: true
artifactErrorsFailBuild: true