| 1 | name: Release CI |
| 2 | |
| 3 | on: |
| 4 | workflow_dispatch: |
| 5 | pull_request: |
| 6 | paths: |
| 7 | - '.github/workflows/release_ci.yml' |
| 8 | push: |
| 9 | paths: |
| 10 | - '.github/workflows/release_ci.yml' |
| 11 | tags: |
| 12 | - weekly.** |
| 13 | - 0.** |
| 14 | |
| 15 | concurrency: |
| 16 | group: release-${{ github.workflow }}-${{ github.ref }} |
| 17 | cancel-in-progress: ${{ github.ref_type != 'tag' }} |
| 18 | |
| 19 | permissions: |
| 20 | contents: write |
| 21 | |
| 22 | jobs: |
| 23 | release-build: |
| 24 | runs-on: ${{ matrix.os }} |
| 25 | strategy: |
| 26 | matrix: |
| 27 | os: |
| 28 | [ |
| 29 | ubuntu-22.04, |
| 30 | ubuntu-22.04-arm, |
| 31 | macos-15-intel, |
| 32 | macos-15, |
| 33 | windows-latest, |
| 34 | ] |
| 35 | include: |
| 36 | - os: ubuntu-22.04 |
| 37 | cc: gcc |
| 38 | target: linux |
| 39 | artifact: v_linux.zip |
| 40 | - os: ubuntu-22.04-arm |
| 41 | cc: gcc |
| 42 | target: linux_arm64 |
| 43 | artifact: v_linux_arm64.zip |
| 44 | - os: macos-15-intel |
| 45 | cc: clang |
| 46 | target: macos_x86_64 |
| 47 | artifact: v_macos_x86_64.zip |
| 48 | - os: macos-15 |
| 49 | cc: clang |
| 50 | target: macos_arm64 |
| 51 | artifact: v_macos_arm64.zip |
| 52 | - os: windows-latest |
| 53 | cc: msvc |
| 54 | target: windows |
| 55 | artifact: v_windows.zip |
| 56 | fail-fast: false |
| 57 | steps: |
| 58 | - uses: actions/checkout@v6 |
| 59 | - name: Compile release binaries |
| 60 | if: runner.os != 'Windows' |
| 61 | run: | |
| 62 | make |
| 63 | ./v -cc ${{ matrix.cc }} ${{ matrix.cflags }} -prod -o v cmd/v |
| 64 | ./v -cc ${{ matrix.cc }} ${{ matrix.cflags }} -prod cmd/tools/vup.v |
| 65 | ./v -cc ${{ matrix.cc }} ${{ matrix.cflags }} -prod cmd/tools/vdoctor.v |
| 66 | - name: Compile release binaries (Windows) |
| 67 | if: runner.os == 'Windows' |
| 68 | run: | |
| 69 | ./makev.bat -msvc |
| 70 | ./v -prod -cc msvc -o cmd/vprod.exe cmd/v |
| 71 | ./v -prod -cc msvc cmd/tools/vup.v |
| 72 | ./v -prod -cc msvc cmd/tools/vdoctor.v |
| 73 | del ./*.exe |
| 74 | del ./*.tmp.obj |
| 75 | move cmd/vprod.exe v.exe |
| 76 | - name: Prepare artifact |
| 77 | shell: bash |
| 78 | run: | |
| 79 | if [[ ${{ matrix.os }} == 'macos-14' ]]; then |
| 80 | rm -rf thirdparty/tcc |
| 81 | git clone --branch thirdparty-macos-arm64 --depth=1 https://github.com/vlang/tccbin thirdparty/tcc |
| 82 | fi |
| 83 | # Remove excluded |
| 84 | if [[ $RUNNER_OS == 'Windows' ]]; then |
| 85 | find . -type f \( -name "*.ilk" -o -name "*.pdb" \) -exec rm -rf {} + |
| 86 | rm -rf v_old.exe |
| 87 | fi |
| 88 | find . -type d -name ".git" -exec rm -rf {} + |
| 89 | rm -rf vc/ |
| 90 | rm -rf v_old |
| 91 | rm -rf vlib/v/tests/bench/gcboehm/*.svg.xz |
| 92 | - name: Create ZIP archive |
| 93 | shell: bash |
| 94 | run: | |
| 95 | cd .. |
| 96 | if [[ $RUNNER_OS == 'Windows' ]]; then |
| 97 | 7z a -tzip ${{ matrix.artifact }} v/ |
| 98 | else |
| 99 | zip -r9 --symlinks ${{ matrix.artifact }} v/ |
| 100 | fi |
| 101 | zipinfo ${{ matrix.artifact }} |
| 102 | mv ${{ matrix.artifact }} v/ |
| 103 | cd v/ |
| 104 | - name: Create artifact |
| 105 | uses: actions/upload-artifact@v7 |
| 106 | with: |
| 107 | name: ${{ matrix.target }} |
| 108 | path: ${{ matrix.artifact }} |
| 109 | |
| 110 | release-publish: |
| 111 | if: github.ref_type == 'tag' |
| 112 | needs: release-build |
| 113 | runs-on: ubuntu-latest |
| 114 | steps: |
| 115 | - uses: actions/download-artifact@v8 |
| 116 | - name: Create release |
| 117 | uses: ncipollo/release-action@v1 |
| 118 | with: |
| 119 | artifacts: | |
| 120 | ~/work/v/v/windows/v_windows.zip |
| 121 | ~/work/v/v/linux/v_linux.zip |
| 122 | ~/work/v/v/linux_arm64/v_linux_arm64.zip |
| 123 | ~/work/v/v/macos_arm64/v_macos_arm64.zip |
| 124 | ~/work/v/v/macos_x86_64/v_macos_x86_64.zip |
| 125 | tag: ${{ github.ref_name }} |
| 126 | name: ${{ github.ref_name }} |
| 127 | draft: false |
| 128 | prerelease: false |
| 129 | |