Build and Release Package #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release Package | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version to build" | |
required: true | |
jobs: | |
build: | |
runs-on: macos-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
repository: Cysharp/YetAnotherHttpHandler | |
ref: ${{ github.event.inputs.version }} | |
path: YetAnotherHttpHandler | |
- name: Modify Package | |
run: | | |
cp -f dist/YetAnotherHttpHandler.meta YetAnotherHttpHandler/src/YetAnotherHttpHandler.meta | |
cp -rf dist/osx-universal YetAnotherHttpHandler/src/YetAnotherHttpHandler/Plugins/Cysharp.Net.Http.YetAnotherHttpHandler.Native/runtimes/ | |
cd YetAnotherHttpHandler/src/YetAnotherHttpHandler/Plugins/Cysharp.Net.Http.YetAnotherHttpHandler.Native/runtimes/ | |
lipo -create osx-arm64/native/libCysharp.Net.Http.YetAnotherHttpHandler.Native.dylib osx-x64/native/libCysharp.Net.Http.YetAnotherHttpHandler.Native.dylib -output osx-universal/libCysharp.Net.Http.YetAnotherHttpHandler.Native.dylib | |
rm -rf osx-arm64 | |
rm -rf osx-x64 | |
rm -f osx-arm64.meta osx-x64.meta | |
- name: Setup Package Content Paths | |
run: | | |
cd YetAnotherHttpHandler | |
mv src Assets | |
echo "Assets/YetAnotherHttpHandler.meta" > Assets/metaList | |
find Assets/YetAnotherHttpHandler/ -name \*.meta >> Assets/metaList | |
- name: Create Unity Package | |
uses: pCYSl5EDgo/create-unitypackage@v1.2.3 | |
with: | |
package-path: "${{ github.workspace }}/YetAnotherHttpHandler-${{ github.event.inputs.version }}.unitypackage" | |
include-files: metaList | |
working-folder: YetAnotherHttpHandler/Assets | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: YetAnotherHttpHandler-${{ github.event.inputs.version }}.unitypackage | |
make_latest: "true" | |
tag_name: ${{ github.event.inputs.version }} |