runner test #8
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 then Draft Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - pre-release | |
| jobs: | |
| build-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Build Lua script | |
| run: bash build.sh | |
| - name: Create Tag | |
| id: create_tag | |
| env: | |
| GH_PAT: ${{ secrets.GH_PAT }} | |
| run: | | |
| BRANCH_NAME="${GITHUB_REF##*/}" | |
| TAG_NAME="${BRANCH_NAME}-auto-$(date +'%Y%m%d-%H%M%S')" | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| git tag $TAG_NAME | |
| git remote set-url origin https://x-access-token:${GH_PAT}@github.com/${GITHUB_REPOSITORY}.git | |
| git push origin $TAG_NAME | |
| echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT | |
| - name: Create Draft Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| files: WirtsTools.lua | |
| tag_name: ${{ steps.create_tag.outputs.tag_name }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_PAT }} |