From a10dfb139a776bc4b2cb7bb11295bb9870cd809f Mon Sep 17 00:00:00 2001 From: mina1460 Date: Thu, 12 Oct 2023 11:15:14 +0300 Subject: [PATCH 1/2] checkout v4 and get tags Signed-off-by: mina1460 --- .github/workflows/charm-build.yaml | 7 +++++-- .github/workflows/charm-release.yaml | 8 ++++++-- .github/workflows/charm-test.yaml | 10 ++++++++-- .github/workflows/charm.yaml | 4 ++-- .github/workflows/ci.yaml | 10 ++++++++-- .github/workflows/snap-release.yaml | 5 ++++- .github/workflows/snap.yaml | 7 +++++-- 7 files changed, 38 insertions(+), 13 deletions(-) diff --git a/.github/workflows/charm-build.yaml b/.github/workflows/charm-build.yaml index b76c0e5cb..57580bd38 100644 --- a/.github/workflows/charm-build.yaml +++ b/.github/workflows/charm-build.yaml @@ -10,8 +10,11 @@ jobs: matrix: charm-type: ["jimm","jimm-k8s"] steps: - - uses: actions/checkout@v3 - - run: git fetch --prune --unshallow + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + - run: git fetch --tags --prune --unshallow - run: sudo snap install charmcraft --channel=2.x/stable --classic - run: sudo charmcraft pack --project-dir ./charms/${{ matrix.charm-type }} --destructive-mode --verbosity=trace - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/charm-release.yaml b/.github/workflows/charm-release.yaml index f335dadc2..8a6f3180a 100644 --- a/.github/workflows/charm-release.yaml +++ b/.github/workflows/charm-release.yaml @@ -27,9 +27,12 @@ jobs: timeout-minutes: 60 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 + fetch-tags: true + - name: Get latest tags + run: git fetch --tags - name: Build local images run: make jimm-image - name: Upload charm to charmhub @@ -52,9 +55,10 @@ jobs: timeout-minutes: 60 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 + fetch-tags: true - uses: actions/download-artifact@master with: name: jimm-snap diff --git a/.github/workflows/charm-test.yaml b/.github/workflows/charm-test.yaml index ac08a8baf..d0d9b73a5 100644 --- a/.github/workflows/charm-test.yaml +++ b/.github/workflows/charm-test.yaml @@ -21,7 +21,10 @@ jobs: working-directory: ./charms/${{ matrix.charm-type }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true - name: Install dependencies run: python3 -m pip install tox - name: Run linters @@ -37,7 +40,10 @@ jobs: working-directory: ./charms/${{ matrix.charm-type }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true - name: Install dependencies run: python -m pip install tox - name: Run tests diff --git a/.github/workflows/charm.yaml b/.github/workflows/charm.yaml index 7e33db97e..00817beaa 100644 --- a/.github/workflows/charm.yaml +++ b/.github/workflows/charm.yaml @@ -18,8 +18,8 @@ jobs: build-charm: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - run: git fetch --prune --unshallow + - uses: actions/checkout@v4 + - run: git fetch --tags --prune --unshallow - run: sudo snap install charmcraft --channel=2.x/stable --classic - run: charmcraft pack --project-dir ./charms/${{ inputs.charm }} --destructive-mode - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ee669223c..baa124852 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,7 +28,10 @@ jobs: name: Build and Test runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + fetch-tags: true + fetch-depth: 0 - uses: actions/setup-go@v4 with: go-version-file: 'go.mod' @@ -60,7 +63,10 @@ jobs: # The docker compose has a healthcheck on the JIMM container. # So if the compose returns with exit code 0 then the JIMM server successfully started. steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true - name: Pull candid repo for test environment run: | git clone https://github.com/canonical/candid.git ./tmp/candid diff --git a/.github/workflows/snap-release.yaml b/.github/workflows/snap-release.yaml index 6ae775e57..68a972e0d 100644 --- a/.github/workflows/snap-release.yaml +++ b/.github/workflows/snap-release.yaml @@ -16,9 +16,12 @@ jobs: snap: ${{ steps.snapcraft.outputs.snap }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 + fetch-tags: true + - name: fetch newest tags + run: git fetch --tags - name: scripts run: | mkdir -p ./snap diff --git a/.github/workflows/snap.yaml b/.github/workflows/snap.yaml index 7acb85e3a..da2d14c66 100644 --- a/.github/workflows/snap.yaml +++ b/.github/workflows/snap.yaml @@ -10,8 +10,11 @@ jobs: build-snap: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - run: git fetch --prune --unshallow + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + - run: git fetch --tags --prune --unshallow - uses: actions/setup-go@v4 with: go-version-file: 'go.mod' From fdba78335fd49aec9bb1e1c5ccdb8542d2ac1b4e Mon Sep 17 00:00:00 2001 From: mina1460 Date: Thu, 12 Oct 2023 11:59:37 +0300 Subject: [PATCH 2/2] rollback fetch --tags but keep v4 --- .github/workflows/charm-build.yaml | 2 +- .github/workflows/charm-release.yaml | 4 +--- .github/workflows/charm.yaml | 2 +- .github/workflows/snap-release.yaml | 2 -- .github/workflows/snap.yaml | 2 +- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/charm-build.yaml b/.github/workflows/charm-build.yaml index 57580bd38..be925efef 100644 --- a/.github/workflows/charm-build.yaml +++ b/.github/workflows/charm-build.yaml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 fetch-tags: true - - run: git fetch --tags --prune --unshallow + - run: git fetch --prune --unshallow - run: sudo snap install charmcraft --channel=2.x/stable --classic - run: sudo charmcraft pack --project-dir ./charms/${{ matrix.charm-type }} --destructive-mode --verbosity=trace - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/charm-release.yaml b/.github/workflows/charm-release.yaml index 8a6f3180a..b35391c9f 100644 --- a/.github/workflows/charm-release.yaml +++ b/.github/workflows/charm-release.yaml @@ -30,9 +30,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - fetch-tags: true - - name: Get latest tags - run: git fetch --tags + fetch-tags: true - name: Build local images run: make jimm-image - name: Upload charm to charmhub diff --git a/.github/workflows/charm.yaml b/.github/workflows/charm.yaml index 00817beaa..98fe7714a 100644 --- a/.github/workflows/charm.yaml +++ b/.github/workflows/charm.yaml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 - - run: git fetch --tags --prune --unshallow + - run: git fetch --prune --unshallow - run: sudo snap install charmcraft --channel=2.x/stable --classic - run: charmcraft pack --project-dir ./charms/${{ inputs.charm }} --destructive-mode - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/snap-release.yaml b/.github/workflows/snap-release.yaml index 68a972e0d..7a7c5393f 100644 --- a/.github/workflows/snap-release.yaml +++ b/.github/workflows/snap-release.yaml @@ -20,8 +20,6 @@ jobs: with: fetch-depth: 0 fetch-tags: true - - name: fetch newest tags - run: git fetch --tags - name: scripts run: | mkdir -p ./snap diff --git a/.github/workflows/snap.yaml b/.github/workflows/snap.yaml index da2d14c66..12776fc92 100644 --- a/.github/workflows/snap.yaml +++ b/.github/workflows/snap.yaml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 fetch-tags: true - - run: git fetch --tags --prune --unshallow + - run: git fetch --prune --unshallow - uses: actions/setup-go@v4 with: go-version-file: 'go.mod'