diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000000..268dd01016e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,89 @@ +name: Talos Image + +on: + push: + branches: [ 'turingrk1', 'release-*' ] + tags: + - "v*" + +jobs: + talos-image: + runs-on: buildjet-4vcpu-ubuntu-2204-arm + + permissions: + contents: read + packages: write + + + steps: + - uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout + uses: actions/checkout@v4 + with: + # need history for `git describe` to work for Talos `Makefile` + fetch-depth: 0 + fetch-tags: true + + - name: Fetch tags from External Repository + run: | + git remote add upstream https://github.com/siderolabs/talos.git + git fetch upstream -t + + - name: Build and push Talos installer image + run: make installer + env: + PUSH: '1' + USERNAME: ${{ github.actor }} + PLATFORM: linux/arm64 + PROGRESS: plain + CI_ARGS: "--cache-from=ghcr.io/${{ github.actor }}/installer:cache --cache-to=ghcr.io/${{ github.actor }}/installer:cache" + + - name: Build and push Talos imager image + run: make imager + env: + PUSH: '1' + USERNAME: ${{ github.actor }} + PLATFORM: linux/arm64 + PROGRESS: plain + CI_ARGS: "--cache-from=ghcr.io/${{ github.actor }}/imager:cache --cache-to=ghcr.io/${{ github.actor }}/imager:cache" + + - name: Build an turing-rk1 flashable image + run: make sbc-turing_rk1 + env: + USERNAME: ${{ github.actor }} + PLATFORM: linux/arm64 + PROGRESS: plain + + - uses: actions/upload-artifact@v3 + with: + name: image-turing-rk1 + path: _out/*.img.xz + if-no-files-found: error + + release: + runs-on: ubuntu-22.04 + needs: talos-image + + permissions: + contents: write + packages: none + + if: startsWith(github.ref, 'refs/tags/') + + steps: + - uses: actions/download-artifact@v3 + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + fail_on_unmatched_files: true + files: 'image-*/*.img.xz' + generate_release_notes: true \ No newline at end of file