From 82e0e7cf61054df09d99861c988a4b60b79b398b Mon Sep 17 00:00:00 2001 From: Tau Date: Mon, 5 Aug 2024 14:21:19 +0000 Subject: [PATCH 1/2] adds support for building main --- .github/workflows/release.yml | 4 ++++ .github/workflows/vib-build.yml | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d21be40..810b939 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,6 +35,10 @@ jobs: with: fetch-depth: 0 + - name: Change tag in recipe. + run: | + sed 's/ghcr.io\/vanilla-os\/core:dev/ghcr.io\/vanilla-os\/core:main/' -i recipe.yml + - uses: vanilla-os/vib-gh-action@v0.7.4 with: recipe: 'recipe.yml' diff --git a/.github/workflows/vib-build.yml b/.github/workflows/vib-build.yml index 2f8d785..fbbfea8 100644 --- a/.github/workflows/vib-build.yml +++ b/.github/workflows/vib-build.yml @@ -4,8 +4,6 @@ on: push: branches: - 'dev' - tags: - - '*' workflow_dispatch: pull_request: @@ -18,6 +16,7 @@ jobs: steps: - name: Verify Base Image Integrity + if: ${{ github.ref == 'refs/heads/main' }} run: gh attestation verify oci://ghcr.io/vanilla-os/core:main --owner Vanilla-OS env: @@ -35,6 +34,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Change tag in recipe. + if: ${{ github.ref == 'refs/heads/main' }} + run: | + sed 's/ghcr.io\/vanilla-os\/core:dev/ghcr.io\/vanilla-os\/core:main/' -i recipe.yml + - uses: vanilla-os/vib-gh-action@v0.7.4 with: recipe: 'recipe.yml' From b56fa77b3df5f1f1d2df21a563339ea3484d3cee Mon Sep 17 00:00:00 2001 From: Tau Date: Mon, 5 Aug 2024 16:05:22 +0200 Subject: [PATCH 2/2] created sync workflow --- .github/workflows/sync-main.yml | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/sync-main.yml diff --git a/.github/workflows/sync-main.yml b/.github/workflows/sync-main.yml new file mode 100644 index 0000000..a056e18 --- /dev/null +++ b/.github/workflows/sync-main.yml @@ -0,0 +1,36 @@ +name: Sync Main Branch + +on: + workflow_dispatch: + +jobs: + check_base_status: + runs-on: ubuntu-latest + steps: + - name: Clone base image. + uses: actions/checkout@v4 + with: + repository: Vanilla-OS/core-image + + - name: Check if base is up to date. + run: | + git fetch origin + main_head=$( git rev-parse origin/main ) + dev_head=$( git rev-parse origin/dev ) + echo main branch is at: $main_head + echo dev branch is at: $dev_head + [ "$main_head" = "$dev_head" ] + + sync: + runs-on: ubuntu-latest + needs: check_base_status + + steps: + - uses: actions/checkout@v4 + with: + ref: dev + fetch-depth: 0 + + - name: Push dev to main. + run: | + git push origin dev:main