nightly-release #318
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: nightly-release | |
| on: | |
| schedule: | |
| - cron: "0 5 * * *" # 每天UTC 05:00运行 | |
| workflow_dispatch: # 允许手动触发 | |
| jobs: | |
| nightly: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.PAT_TOKEN }} | |
| submodules: recursive | |
| - name: Install upx | |
| run: sudo apt install upx -y | |
| continue-on-error: true | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.20" | |
| - name: Configure Git | |
| run: | | |
| git config --global url."https://${{ secrets.PAT_TOKEN }}@github.com/".insteadOf "https://github.com/" | |
| - name: Set Version Info | |
| run: | | |
| echo "NIGHTLY_VERSION=nightly-$(date +'%Y%m%d')" >> $GITHUB_ENV | |
| echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v4 | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| args: release --snapshot --clean --skip=publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
| VERSION: ${{ env.NIGHTLY_VERSION }} | |
| GOPATH: "/home/runner/go" | |
| COMMIT: ${{ env.COMMIT }} | |
| CGO_ENABLED: 0 | |
| - name: Download IoM-gui VSIX | |
| uses: robinraju/[email protected] | |
| with: | |
| repository: "chainreactors/IoM-gui" | |
| latest: true | |
| fileName: "iom.vsix" | |
| token: ${{ secrets.PAT_TOKEN }} | |
| out-file-path: "dist/vsix" | |
| - name: Delete Old Nightly Releases | |
| uses: dev-drprasad/[email protected] | |
| with: | |
| keep_latest: 7 | |
| delete_tags: true | |
| delete_tag_pattern: nightly | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: Nightly Build ${{ env.NIGHTLY_VERSION }} | |
| tag_name: nightly | |
| prerelease: true | |
| files: | | |
| dist/**/* | |
| body: | | |
| 🌙 Nightly build | |
| 📝 Commit: ${{ env.COMMIT }} | |
| ⚠️ This is an automated nightly build and may be unstable. | |
| 📦 This release includes the latest changes from the main branch. | |
| Usage: https://chainreactors.github.io/wiki/IoM/manual/manual/GUI | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} |