Manual Release Creator #35
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: Manual Release Creator | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag_name: | |
| description: 'The tag name for the release (e.g., v0.1.0)' | |
| required: true | |
| default: 'v0.1.0-alpha' | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: Install Dependencies | |
| run: go mod tidy | |
| working-directory: ./core_engine | |
| - name: Build Go Executable | |
| env: | |
| GOOS: linux | |
| GOARCH: amd64 | |
| run: go build -v -o core_engine ./core_engine | |
| - name: Create Zip Archive | |
| run: zip core_engine.zip core_engine | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-artifact | |
| path: core_engine.zip | |
| create-release: | |
| needs: build-and-release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # 🔹 Commit خالی ایجاد میکنیم تا release روی commit جدید باشه | |
| - name: Create empty commit for release | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| git commit --allow-empty -m "chore: release ${{ github.event.inputs.tag_name }}" | |
| git push origin HEAD:main | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create Release and Upload Assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.event.inputs.tag_name }} | |
| name: Release ${{ github.event.inputs.tag_name }} | |
| body: "" | |
| files: artifacts/**/*.zip |