Merge pull request #15 from AmeliaCute/deployement #15
This file contains hidden or 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 deploy project" | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| env: | |
| BUILD_TYPE: Release | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Pull submodule | |
| run: git submodule update --init | |
| - name: Configure CMake | |
| run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
| - name: Build project | |
| run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fli-modloader | |
| path: | | |
| ./build/Release/ModLoader.dll | |
| ./build/DllProxy/Release/version.dll | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up date-based tag | |
| run: | | |
| DATE_TAG="v$(date +'%Y%m%d.%H%M')" | |
| echo "TAG_NAME=$DATE_TAG" >> $GITHUB_ENV | |
| echo "{tag}=$DATE_TAG" | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.TAG_NAME }} | |
| body: "Automated release of ${{ github.ref_name }}." | |
| generate_release_notes: true | |
| token: ${{ secrets.RELEASE_CD_TOKEN }} | |
| - name: Upload ModLoader.dll | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_CD_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: "./fli-modloader/Release/ModLoader.dll" | |
| asset_name: ModLoader.dll | |
| asset_content_type: application/octet-stream | |
| - name: Upload version.dll | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_CD_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: "./fli-modloader/DllProxy/Release/version.dll" | |
| asset_name: version.dll | |
| asset_content_type: application/octet-stream |