nightly-release #442
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.24.13" | |
| - name: Configure Git | |
| run: | | |
| git config --global url."https://${{ secrets.PAT_TOKEN }}@github.com/".insteadOf "https://github.com/" | |
| - name: Update submodules to latest | |
| run: git submodule update --remote | |
| - 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/release-downloader@v1.11 | |
| 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/delete-older-releases@v0.3.2 | |
| 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/iom_* | |
| dist/malice_network_* | |
| dist/malice_checksums.txt | |
| dist/vsix/iom.vsix | |
| body: | | |
| 🌙 Nightly Build / 每夜构建 | |
| Commit / 提交: [`${{ env.COMMIT }}`](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}) | |
| Branch / 分支: `${{ github.ref_name }}` | |
| ⚠️ Automated nightly build, may be unstable. | |
| ⚠️ 自动构建版本,可能不稳定。 | |
| 📦 Includes latest changes from `dev`. | |
| 📦 包含 `dev` 分支最新变更。 | |
| 📚 Docs / 文档: https://wiki.chainreactors.red/ | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} |