Prepare for first beta release #1
Workflow file for this run
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: Create Release | |
| # This workflow runs automatically when a new tag is pushed to the repository | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Trigger on any tag that starts with 'v', e.g., v1.0.0, v1.1.0-beta1 | |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
| jobs: | |
| build-and-release: | |
| # The type of runner that the job will run on. Windows is best for .NET Framework. | |
| runs-on: windows-latest | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| # Step 1: Check out the repository code so the runner can access it | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # Step 2: Set up the .NET SDK environment | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.x' # Use a modern SDK to build the project | |
| # Step 3: Build the project in Release configuration | |
| # IMPORTANT: Replace 'YourProjectName.csproj' with the actual path to your .csproj file | |
| - name: Build Project | |
| run: dotnet build --configuration Release DDLCScreenReaderMod.csproj | |
| # Step 4: Prepare the files for the release package | |
| - name: Prepare Release Package | |
| run: | | |
| # Create a directory to hold the release files | |
| mkdir release | |
| # Copy the built DLL into the release directory. | |
| # IMPORTANT: Adjust the path to match your project's output directory structure. | |
| cp "bin/Release/net472/DDLCScreenReaderMod.dll" "release/" | |
| # Copy the instructions file into the release directory. | |
| cp "INSTALL_INSTRUCTIONS.txt" "release/" | |
| shell: pwsh # Use PowerShell, which is default on windows-latest | |
| # Step 5: Create a ZIP archive of the release files | |
| - name: Create ZIP Archive | |
| run: Compress-Archive -Path release/* -DestinationPath "DDLCScreenReaderMod-${{ github.ref_name }}.zip" | |
| shell: pwsh | |
| # Step 6: Create the GitHub Release draft | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| release_name: Release ${{ github.ref_name }} | |
| body: | | |
| This is a pre-release version for beta testing. | |
| Please see the `INSTALL_INSTRUCTIONS.txt` file inside the ZIP archive for installation steps. | |
| Thank you for your feedback! | |
| draft: false | |
| prerelease: true # Mark this as a pre-release | |
| # Step 7: Upload the ZIP archive as an asset to the release | |
| - name: Upload Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./DDLCScreenReaderMod-${{ github.ref_name }}.zip | |
| asset_name: DDLCScreenReaderMod-${{ github.ref_name }}.zip | |
| asset_content_type: application/zip |