diff --git a/.github/actions/build-cuttlefish-cvdremote-debian-package/action.yaml b/.github/actions/build-cuttlefish-cvdremote-debian-package/action.yaml index 2bcabdc6..7ad520e6 100644 --- a/.github/actions/build-cuttlefish-cvdremote-debian-package/action.yaml +++ b/.github/actions/build-cuttlefish-cvdremote-debian-package/action.yaml @@ -1,7 +1,4 @@ name: 'Build debian package cuttlefish-cvdremote' -inputs: - arch: - required: true runs: using: "composite" steps: @@ -16,13 +13,12 @@ runs: run: apt install -y config-package-dev debhelper-compat devscripts git golang shell: bash - name: Build package - run: cd build/debian/cuttlefish_cvdremote && dpkg-buildpackage -i -uc -us -b + run: | + pushd build/debian/cuttlefish_cvdremote + dpkg-buildpackage -i -uc -us -b + popd + mv build/debian/cuttlefish-cvdremote_*.deb . shell: bash - name: Install package - run: dpkg -i build/debian/cuttlefish-cvdremote_*.deb || apt install -y + run: dpkg -i cuttlefish-cvdremote_*.deb || apt install -y shell: bash - - name: Upload debian package - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # aka v4.0.0 - with: - name: cuttlefish-cvdremote-${{ inputs.arch }} - path: build/debian/cuttlefish-cvdremote_*.deb diff --git a/.github/actions/deploy-cuttlefish-cvdremote-debian-package/action.yaml b/.github/actions/deploy-cuttlefish-cvdremote-debian-package/action.yaml new file mode 100644 index 00000000..55935087 --- /dev/null +++ b/.github/actions/deploy-cuttlefish-cvdremote-debian-package/action.yaml @@ -0,0 +1,19 @@ +name: 'Deploy debian package cuttlefish-cvdremote' +inputs: + path: + required: true +runs: + using: "composite" + steps: + - name: 'Set up Cloud SDK' + uses: 'google-github-actions/setup-gcloud@v3.0.0' + with: + version: '>= 363.0.0' + - name: Deploy deb package into Artifact Registry + run: | + gcloud --project=android-cuttlefish-artifacts \ + artifacts apt upload \ + android-cuttlefish-nightly \ + --location=us \ + --source=${{ inputs.path }} + shell: bash diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml new file mode 100644 index 00000000..05096cb2 --- /dev/null +++ b/.github/workflows/deployment.yaml @@ -0,0 +1,54 @@ +name: Deploy artifacts + +on: + push: + branches: + - main + +permissions: + contents: read + +jobs: + deploy-cuttlefish-cvdremote-amd64-debian-package: + if: ${{ github.repository_owner == 'google' }} + environment: deployment + runs-on: ubuntu-24.04 + container: + image: debian@sha256:9258a75a7e4323c9e5562b361effc84ee747920116d8adfc98a465a5cdc9150e # debian:bookworm-20250407 (amd64) + steps: + - name: Checkout repository + uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2 + - name: Build debian package cuttlefish-cvdremote + uses: ./.github/actions/build-cuttlefish-cvdremote-debian-package + - name: Get exact filename + run: echo "path=$(find . -name cuttlefish-cvdremote_*.deb)" >> $GITHUB_ENV + - name: Authentication on GCP project android-cuttlefish-artifacts + uses: 'google-github-actions/auth@v2' + with: + credentials_json: '${{ secrets.ARTIFACT_REGISTRY_UPLOADER }}' + - name: Deploy debian package cuttlefish-cvdremote + uses: ./.github/actions/deploy-cuttlefish-cvdremote-debian-package + with: + path: ${{ env.path }} + + deploy-cuttlefish-cvdremote-arm64-debian-package: + if: ${{ github.repository_owner == 'google' }} + environment: deployment + runs-on: ubuntu-24.04-arm + container: + image: debian@sha256:00cd074b40c4d99ff0c24540bdde0533ca3791edcdac0de36d6b9fb3260d89e2 # debian:bookworm-20250407 (arm64/v8) + steps: + - name: Checkout repository + uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2 + - name: Build debian package cuttlefish-cvdremote + uses: ./.github/actions/build-cuttlefish-cvdremote-debian-package + - name: Get exact filename + run: echo "path=$(find . -name cuttlefish-cvdremote_*.deb)" >> $GITHUB_ENV + - name: Authentication on GCP project android-cuttlefish-artifacts + uses: 'google-github-actions/auth@v2' + with: + credentials_json: '${{ secrets.ARTIFACT_REGISTRY_UPLOADER }}' + - name: Deploy debian package cuttlefish-cvdremote + uses: ./.github/actions/deploy-cuttlefish-cvdremote-debian-package + with: + path: ${{ env.path }} diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index 323634c2..37c50bfe 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -31,7 +31,7 @@ jobs: version: "latest" install-go: false - build-cuttlefish-cvdremote-x86_64-debian-package: + build-cuttlefish-cvdremote-amd64-debian-package: runs-on: ubuntu-24.04 container: image: debian@sha256:9258a75a7e4323c9e5562b361effc84ee747920116d8adfc98a465a5cdc9150e # debian:bookworm-20250407 (amd64) @@ -40,8 +40,11 @@ jobs: uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2 - name: Build debian package cuttlefish-cvdremote uses: ./.github/actions/build-cuttlefish-cvdremote-debian-package + - name: Upload debian package + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # aka v4.0.0 with: - arch: x86_64 + name: cuttlefish-cvdremote-amd64 + path: cuttlefish-cvdremote_*.deb build-cuttlefish-cvdremote-arm64-debian-package: runs-on: ubuntu-24.04-arm @@ -52,8 +55,11 @@ jobs: uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2 - name: Build debian package cuttlefish-cvdremote uses: ./.github/actions/build-cuttlefish-cvdremote-debian-package + - name: Upload debian package + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # aka v4.0.0 with: - arch: arm64 + name: cuttlefish-cvdremote-arm64 + path: cuttlefish-cvdremote_*.deb build-cuttlefish-cloud-orchestrator-x86_64-docker-image: runs-on: ubuntu-24.04 @@ -77,7 +83,7 @@ jobs: e2e-test-cvdr-with-on-premise-cloud-orchestrator: runs-on: ubuntu-24.04 - needs: [build-cuttlefish-cloud-orchestrator-x86_64-docker-image, build-cuttlefish-cvdremote-x86_64-debian-package] + needs: [build-cuttlefish-cloud-orchestrator-x86_64-docker-image, build-cuttlefish-cvdremote-amd64-debian-package] steps: - name: Checkout repository uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2 @@ -99,7 +105,7 @@ jobs: - name: Download cuttlefish-cvdremote uses: actions/download-artifact@7a1cd3216ca9260cd8022db641d960b1db4d1be4 # aka v4.0.0 with: - name: cuttlefish-cvdremote-x86_64 + name: cuttlefish-cvdremote-amd64 path: cuttlefish-cvdremote - name: Install cuttlefish-cvdremote run: sudo apt-get install -y ./cuttlefish-cvdremote/cuttlefish-cvdremote_*_*64.deb