workflow fix #19
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: Editor Build and Release | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build-editor: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout Vortex Engine | |
uses: actions/checkout@v4 | |
with: | |
repository: 'StoneOrbits/VortexEngine' | |
path: 'VortexEditor/VortexEngine' | |
ref: 'desktop' | |
- name: Set up MSBuild path | |
uses: microsoft/setup-msbuild@v1 | |
- name: Build | |
run: msbuild VortexEditor.sln /p:Configuration=Release /p:Platform=x64 | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Binaries | |
path: x64/Release/VortexEditor.exe | |
calculate-version: | |
runs-on: windows-latest | |
needs: build-editor | |
outputs: | |
version: ${{ steps.find_version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: 'StoneOrbits/VortexEngine' | |
path: 'VortexEngine' | |
ref: 'desktop' | |
fetch-depth: 0 # Fetch all history for tags | |
- name: Find latest 'desktop' version tag | |
id: find_version | |
shell: bash | |
run: | | |
cd VortexEngine | |
# Fetch all tags | |
git fetch --tags | |
# Get the latest 'l' (library for desktop) tag | |
latest_tag=$(git tag --list '*l' | sort -V | tail -n1 | cut -dl -f1) | |
echo "Latest desktop version tag: $latest_tag" | |
echo "version=1.0.$latest_tag" >> $GITHUB_OUTPUT | |
# create-release: | |
# needs: [build-editor, calculate-version] | |
# runs-on: windows-latest | |
# if: github.ref == 'refs/heads/master' | |
# steps: | |
# - uses: actions/download-artifact@v2 | |
# with: | |
# name: Binaries | |
# path: x64/Release | |
# # commenting out the create release step for now | |
# #- name: Create Release for Editor | |
# # id: create_release | |
# # uses: actions/create-release@v1 | |
# # env: | |
# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# # with: | |
# # tag_name: ${{ needs.calculate-version.outputs.version }} | |
# # release_name: Vortex Editor Release ${{ needs.calculate-version.outputs.version }} | |
# # draft: false | |
# # prerelease: false | |
# - name: Upload Release Asset for Editor | |
# uses: actions/upload-release-asset@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# upload_url: ${{ steps.create_release.outputs.upload_url }} | |
# asset_path: ./x64/Release/VortexEditor.exe | |
# asset_name: VortexEditor-${{ needs.calculate-version.outputs.version }}.exe | |
# asset_content_type: application/octet-stream | |
upload-release: | |
needs: [build-editor, calculate-version] | |
runs-on: windows-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: Binaries | |
path: x64/Release | |
- name: Upload to server | |
shell: bash | |
run: | | |
VERSION=${{ needs.calculate-version.outputs.version }} | |
DEVICE_TYPE="desktop" | |
FILENAME="VortexEditor-${DEVICE_TYPE}-${VERSION}.exe" | |
# Rename the file to include the version (Windows syntax) | |
mv "x64/Release/VortexEditor.exe" $FILENAME | |
# Assuming you have an endpoint set up for firmware upload | |
curl -X POST \ | |
-F "file=@$FILENAME" \ | |
-F "device=$DEVICE_TYPE" \ | |
-F "version=$VERSION" \ | |
-F "category=editor" \ | |
-F "clientApiKey=${{ secrets.VORTEX_COMMUNITY_API_KEY }}" \ | |
https://vortex.community/firmware/upload | |
env: | |
VORTEX_COMMUNITY_API_KEY: ${{ secrets.VORTEX_COMMUNITY_API_KEY }} |