|
| 1 | +name: Devbuild |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_run: |
| 5 | + workflows: |
| 6 | + - CI |
| 7 | + types: |
| 8 | + - completed |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +permissions: |
| 12 | + actions: read |
| 13 | + contents: write |
| 14 | + |
| 15 | +jobs: |
| 16 | + publish-devbuild: |
| 17 | + name: Publish Devbuild |
| 18 | + if: | |
| 19 | + github.event_name == 'workflow_dispatch' || |
| 20 | + ( |
| 21 | + github.event.workflow_run.conclusion == 'success' && |
| 22 | + github.event.workflow_run.head_branch == 'master' |
| 23 | + ) |
| 24 | + runs-on: ubuntu-latest |
| 25 | + |
| 26 | + steps: |
| 27 | + - name: Checkout |
| 28 | + uses: actions/checkout@v6 |
| 29 | + with: |
| 30 | + fetch-depth: 0 |
| 31 | + ref: ${{ github.event.workflow_run.head_sha || github.sha }} |
| 32 | + |
| 33 | + - name: Set up Go |
| 34 | + uses: actions/setup-go@v6 |
| 35 | + with: |
| 36 | + go-version-file: go.mod |
| 37 | + |
| 38 | + - name: Install go-win7 toolchain |
| 39 | + shell: bash |
| 40 | + run: | |
| 41 | + sudo chmod 777 /opt |
| 42 | + mkdir -p /opt/go-win7 |
| 43 | + curl -L https://github.com/XTLS/go-win7/releases/download/patched-1.26.0.2026.02.14/go-for-win7-linux-amd64.zip -o go-win7.zip |
| 44 | + unzip -qq go-win7.zip -d /opt/go-win7 |
| 45 | + sudo ln -f -s /opt/go-win7/bin/go /usr/bin/go-win7 |
| 46 | +
|
| 47 | + - name: Install CycloneDX gomod |
| 48 | + uses: CycloneDX/gh-gomod-generate-sbom@v2 |
| 49 | + with: |
| 50 | + version: v1 |
| 51 | + |
| 52 | + - name: Install release prerequisites |
| 53 | + shell: bash |
| 54 | + run: | |
| 55 | + sudo apt-get update |
| 56 | + sudo apt-get install -y --no-install-recommends powershell curl unzip |
| 57 | +
|
| 58 | + - name: Set up Node |
| 59 | + uses: actions/setup-node@v6 |
| 60 | + with: |
| 61 | + node-version: 22 |
| 62 | + cache: npm |
| 63 | + cache-dependency-path: modules/frontend/vendor-src/package-lock.json |
| 64 | + |
| 65 | + - name: Build devbuild artifacts |
| 66 | + shell: pwsh |
| 67 | + run: ./build.ps1 |
| 68 | + |
| 69 | + - name: Refresh devbuild tag |
| 70 | + env: |
| 71 | + GH_TOKEN: ${{ github.token }} |
| 72 | + shell: bash |
| 73 | + run: | |
| 74 | + gh release delete devbuild --cleanup-tag >/dev/null 2>&1 || true |
| 75 | + git tag -f devbuild |
| 76 | + git push origin refs/tags/devbuild --force |
| 77 | +
|
| 78 | + - name: Publish prerelease |
| 79 | + env: |
| 80 | + GH_TOKEN: ${{ github.token }} |
| 81 | + shell: bash |
| 82 | + run: | |
| 83 | + if gh release view devbuild >/dev/null 2>&1; then |
| 84 | + gh release upload devbuild binaries/* --clobber |
| 85 | + else |
| 86 | + gh release create devbuild binaries/* \ |
| 87 | + --title "devbuild" \ |
| 88 | + --prerelease \ |
| 89 | + --notes "Latest development build from master." |
| 90 | + fi |
0 commit comments