Manual Release #2
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 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version (e.g., v1.2.3)' | |
| required: true | |
| type: string | |
| prerelease: | |
| description: 'Mark as pre-release' | |
| required: false | |
| type: boolean | |
| default: false | |
| release_notes: | |
| description: 'Custom release notes (optional)' | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| manual-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.23' | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'yarn' | |
| cache-dependency-path: web/vue/yarn.lock | |
| - name: Install frontend dependencies | |
| run: | | |
| cd web/vue | |
| yarn install --frozen-lockfile | |
| - name: Build frontend | |
| run: make build-vue | |
| - name: Generate static assets | |
| run: | | |
| go install github.com/rakyll/statik@latest | |
| go generate ./... | |
| - name: Build packages for all platforms | |
| run: | | |
| chmod +x package.sh | |
| bash ./package.sh -p "linux,darwin,windows" -a "amd64,arm64" -v "${{ github.event.inputs.version }}" | |
| - name: Generate release notes | |
| id: release_notes | |
| run: | | |
| VERSION="${{ github.event.inputs.version }}" | |
| if [ -n "${{ github.event.inputs.release_notes }}" ]; then | |
| echo "${{ github.event.inputs.release_notes }}" > release_notes.md | |
| echo "" >> release_notes.md | |
| fi | |
| - name: Create Git Tag | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag -a "${{ github.event.inputs.version }}" -m "Release ${{ github.event.inputs.version }}" | |
| git push origin "${{ github.event.inputs.version }}" | |
| - name: Create Release | |
| run: | | |
| PRERELEASE_FLAG="" | |
| if [ "${{ github.event.inputs.prerelease }}" = "true" ]; then | |
| PRERELEASE_FLAG="--prerelease" | |
| fi | |
| gh release create "${{ github.event.inputs.version }}" \ | |
| --title "Release ${{ github.event.inputs.version }}" \ | |
| --notes-file release_notes.md \ | |
| $PRERELEASE_FLAG \ | |
| gocron-package/*.tar.gz \ | |
| gocron-package/*.zip \ | |
| gocron-node-package/*.tar.gz \ | |
| gocron-node-package/*.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |