|
| 1 | +name: Nightly |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - devel |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-cores: |
| 10 | + uses: ./.github/workflows/build-cores.yml |
| 11 | + |
| 12 | + nightly: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + needs: build-cores |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v6 |
| 19 | + with: |
| 20 | + submodules: recursive |
| 21 | + fetch-depth: 0 |
| 22 | + |
| 23 | + - name: Set up Nim |
| 24 | + uses: jiro4989/setup-nim-action@v2 |
| 25 | + with: |
| 26 | + nim-version: "2.2.8" |
| 27 | + |
| 28 | + - name: Cache Nim packages |
| 29 | + uses: actions/cache@v4 |
| 30 | + with: |
| 31 | + path: | |
| 32 | + ~/.nimble |
| 33 | + ~/.cache/nim |
| 34 | + key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }} |
| 35 | + restore-keys: | |
| 36 | + ${{ runner.os }}-nimble- |
| 37 | +
|
| 38 | + - name: Install Zig |
| 39 | + uses: goto-bus-stop/setup-zig@v2 |
| 40 | + with: |
| 41 | + version: 0.15.2 |
| 42 | + |
| 43 | + - name: Cache Zig |
| 44 | + uses: actions/cache@v4 |
| 45 | + with: |
| 46 | + path: | |
| 47 | + ~/.cache/zig |
| 48 | + ${{ github.workspace }}/zig-cache |
| 49 | + key: ${{ runner.os }}-zig-0.15.2-${{ hashFiles('**/*.zig', 'build.zig', 'build.zig.zon') }} |
| 50 | + restore-keys: | |
| 51 | + ${{ runner.os }}-zig-0.15.2- |
| 52 | +
|
| 53 | + - name: Install Rust |
| 54 | + uses: dtolnay/rust-toolchain@stable |
| 55 | + with: |
| 56 | + targets: armv7-unknown-linux-musleabihf |
| 57 | + |
| 58 | + - name: Cache Cargo |
| 59 | + uses: actions/cache@v4 |
| 60 | + with: |
| 61 | + path: | |
| 62 | + ~/.cargo/bin/ |
| 63 | + ~/.cargo/registry/index/ |
| 64 | + ~/.cargo/registry/cache/ |
| 65 | + ~/.cargo/git/db/ |
| 66 | + target/ |
| 67 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }} |
| 68 | + restore-keys: | |
| 69 | + ${{ runner.os }}-cargo- |
| 70 | +
|
| 71 | + - name: Install dependencies |
| 72 | + run: | |
| 73 | + sudo apt-get update |
| 74 | + sudo apt-get install cmake binutils-arm-linux-gnueabihf openssh-client -y |
| 75 | +
|
| 76 | + - name: Install cargo-zigbuild |
| 77 | + run: | |
| 78 | + if ! command -v cargo-zigbuild &> /dev/null; then |
| 79 | + cargo install cargo-zigbuild |
| 80 | + fi |
| 81 | + echo "$HOME/.cargo/bin" >> $GITHUB_PATH |
| 82 | +
|
| 83 | + - name: Install Nim zigcc wrapper |
| 84 | + run: | |
| 85 | + if ! nimble path zigcc &> /dev/null 2>&1; then |
| 86 | + nimble install zigcc -y |
| 87 | + fi |
| 88 | +
|
| 89 | + - name: Get commit info |
| 90 | + id: hash |
| 91 | + run: | |
| 92 | + HASH=$(git rev-parse --short=8 HEAD) |
| 93 | + COMMIT_MSG=$(git log -1 --pretty=%B | head -n 1) |
| 94 | + echo "hash=$HASH" >> $GITHUB_OUTPUT |
| 95 | + echo "commit_msg=$COMMIT_MSG" >> $GITHUB_OUTPUT |
| 96 | + echo "Commit: $HASH - $COMMIT_MSG" |
| 97 | +
|
| 98 | + - name: Download RetroArch cores |
| 99 | + uses: actions/download-artifact@v4 |
| 100 | + with: |
| 101 | + name: ${{ needs.build-cores.outputs.artifact-name }} |
| 102 | + path: retroarch-cores |
| 103 | + |
| 104 | + - name: Build nightly |
| 105 | + run: NIGHTLY=1 nimble updater -y --verbose |
| 106 | + |
| 107 | + - name: Delete old continuous release |
| 108 | + run: "gh release delete nightly -y --cleanup-tag || true" |
| 109 | + env: |
| 110 | + GH_TOKEN: ${{ github.token }} |
| 111 | + |
| 112 | + - name: Create continuous release |
| 113 | + id: create_release |
| 114 | + uses: actions/create-release@v1 |
| 115 | + env: |
| 116 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 117 | + with: |
| 118 | + tag_name: nightly |
| 119 | + release_name: "Continuous build" |
| 120 | + body: | |
| 121 | + Automated build of the latest commit. Do note that these builds are not stable. |
| 122 | + For stable releases, see the [releases page](https://github.com/${{ github.repository }}/releases). |
| 123 | +
|
| 124 | + **Commit:** `${{ steps.hash.outputs.hash }}` |
| 125 | + **Message:** ${{ steps.hash.outputs.commit_msg }} |
| 126 | + **Built:** ${{ github.event.head_commit.timestamp }} |
| 127 | +
|
| 128 | + draft: false |
| 129 | + prerelease: true |
| 130 | + |
| 131 | + - name: Upload BASE zip |
| 132 | + uses: actions/upload-release-asset@v1 |
| 133 | + env: |
| 134 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 135 | + with: |
| 136 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 137 | + asset_path: ./Quark-${{ steps.hash.outputs.hash }}-BASE.zip |
| 138 | + asset_name: Quark-${{ steps.hash.outputs.hash }}-BASE.zip |
| 139 | + asset_content_type: application/zip |
| 140 | + |
| 141 | + - name: Upload Updater zip |
| 142 | + uses: actions/upload-release-asset@v1 |
| 143 | + env: |
| 144 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 145 | + with: |
| 146 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 147 | + asset_path: ./Quark-${{ steps.hash.outputs.hash }}-Updater.zip |
| 148 | + asset_name: Quark-${{ steps.hash.outputs.hash }}-Updater.zip |
| 149 | + asset_content_type: application/zip |
| 150 | + |
| 151 | + - name: Upload via SFTP |
| 152 | + env: |
| 153 | + SFTP_KEY: ${{ secrets.SFTP_KEY }} |
| 154 | + run: | |
| 155 | + echo "$SFTP_KEY" > /tmp/sftp_key |
| 156 | + chmod 600 /tmp/sftp_key |
| 157 | + sftp -o StrictHostKeyChecking=accept-new -i /tmp/sftp_key debian@q.sartor.vip <<EOF |
| 158 | + put Quark-${{ steps.hash.outputs.hash }}-Updater.zip /var/www/qstore/store/packages/vip.sartor.q.nightly.zip |
| 159 | + bye |
| 160 | + EOF |
| 161 | + rm /tmp/sftp_key |
0 commit comments