Tets autobuild #42
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/upload auxiliary files to the release. | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| - 'main' | |
| - 'dev' | |
| paths-ignore: | |
| - '*.txt' | |
| - '*.md' | |
| jobs: | |
| upload_github_release: | |
| # Upload artifact linked to GitHub RELEASE we are creating - only if the run is for a pull request, or for selected branches | |
| #if: contains(fromJson('["master", "main"]'), github.ref_name) | |
| permissions: | |
| contents: write | |
| actions: read | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| # Step 1: Determine Tag and Release Name based on branch | |
| # This sets environment variables for the rest of the workflow | |
| # name is different if it's dev banch or other (main or master) | |
| - name: Set Release Variables | |
| run: | | |
| if [[ "${{ github.ref_name }}" == "dev" ]]; then | |
| echo "TARGET_TAG=Development" >> $GITHUB_ENV | |
| echo "RELEASE_NAME=Development Build" >> $GITHUB_ENV | |
| else | |
| echo "TARGET_TAG=Nightly" >> $GITHUB_ENV | |
| echo "RELEASE_NAME=Nightly Build" >> $GITHUB_ENV | |
| fi | |
| # Step 2: Update Tag using native Git commands | |
| - name: Update Git Tag | |
| run: | | |
| # Configure identity | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| # Force the tag locally and push it to origin | |
| # Use the environment variable set in Step 1 | |
| git tag -f ${{ env.TARGET_TAG }} | |
| #git push -f origin ${{ env.TARGET_TAG }} | |
| # Step 3: Generate the file to upload | |
| - name: Generate changelog | |
| run: git log --pretty=format:"%ad %an %s" --date=short > Git-Changelog.txt | |
| # Step 3: Update the GitHub Release page | |
| - name: Add auxiliary files to the release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| # Use dynamic variables | |
| name: "${{ env.RELEASE_NAME }}" | |
| tag_name: ${{ env.TARGET_TAG }} | |
| prerelease: true | |
| files: Git-Changelog.txt | |
| # Overwrite existing assets with the same name | |
| overwrite: true | |
| # Place the experimental option here: | |
| move_existing_tag: true |