Change release draft status to true in build.yml #23
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 C++Builder Project (Self-hosted) | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| # Êëþ÷åâîé ìîìåíò: óêàçûâàåì ìåòêè âàøåãî runner | |
| runs-on: [Windows, x64, Self-hosted] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Build Environment | |
| shell: cmd | |
| run: | | |
| echo "C++Builder environment set." | |
| - name: Build Project (Debug) | |
| shell: cmd | |
| run: | | |
| echo "Building the project..." | |
| call E:\actions-runner\build_v8reader.cmd | |
| echo "Build finished." | |
| - name: Upload Build Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: v8reader | |
| path: S:/work/CPP/BDS13/v8reader/Win32/Debug/v8reader.exe | |
| # Îáû÷íî áèíàðíèê ñîçäàåòñÿ â ïîäïàïêå Win32/Release | |
| release: | |
| # Запускаем ТОЛЬКО при пуше тега | |
| # if: startsWith(github.ref, 'refs/tags/') | |
| # Ждем успешной сборки | |
| needs: build | |
| runs-on: ubuntu-latest # Для этого job подходит стандартный runner | |
| # Необходимое разрешение для создания релизов[citation:4][citation:8] | |
| permissions: | |
| contents: write | |
| steps: | |
| # 1. Скачиваем артефакты, которые загрузил job 'build' | |
| - name: Download Build Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: v8reader | |
| path: ./release-files # Скачиваем в конкретную папку | |
| # 2. Проверяем, что скачали | |
| - name: Debug - List downloaded files | |
| run: | | |
| echo "Содержимое папки release-files:" | |
| ls -la ./release-files/ | |
| echo "---" | |
| find ./release-files -type f | |
| # 2. Создаем релиз на GitHub | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 # Популярная и простая в настройке альтернатива[citation:4][citation:7] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref_name }} # Имя тега (например, v1.0.0) | |
| name: Release ${{ github.ref_name }} | |
| body: | | |
| Автоматический релиз версии ${{ github.ref_name }}. | |
| ### Что нового | |
| - Описание изменений здесь... | |
| draft: true # false = опубликовать сразу | |
| prerelease: false | |
| files: | | |
| ./release-files/* | |
| # files: указывать не нужно, т.к. артефакты уже в рабочей директории | |
| # action автоматически загрузит все файлы из текущей папки[citation:4] |