Skip to content

Commit

Permalink
Merge pull request #142 from viccuad/main
Browse files Browse the repository at this point in the history
fix: Don't compare version on CI for rust policies
  • Loading branch information
flavio authored Dec 20, 2024
2 parents bcfa376 + b582f09 commit 588eb8b
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 57 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/reusable-release-policy-assemblyscript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
NODE_VERSION: 14
steps:
- name: Install dependencies
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- uses: actions/checkout@v4
with:
# until https://github.com/actions/checkout/pull/579 is released
Expand All @@ -44,7 +44,7 @@ jobs:
- name: Check that artifacthub-pkg.yml is up-to-date
# skip when releasing :latest from main, versions will not match
if: startsWith(github.ref, 'refs/tags/v') && inputs.artifacthub
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
version: ${{ steps.calculate-version.outputs.version }}
- name: Setup node
Expand All @@ -67,7 +67,7 @@ jobs:
run: |
make e2e-tests
- name: Release
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
oci-target: ${{ inputs.oci-target }}
Expand All @@ -83,4 +83,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Push artifacthub files to artifacthub branch
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
10 changes: 5 additions & 5 deletions .github/workflows/reusable-release-policy-go-wasi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- uses: actions/checkout@v4
with:
# until https://github.com/actions/checkout/pull/579 is released
Expand All @@ -42,16 +42,16 @@ jobs:
- name: Check that artifacthub-pkg.yml is up-to-date
# skip when releasing :latest from main, versions will not match
if: startsWith(github.ref, 'refs/tags/v') && inputs.artifacthub
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
version: ${{ steps.calculate-version.outputs.version }}
- name: Build and annotate policy
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- name: Run e2e tests
run: |
make e2e-tests
- name: Release
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
oci-target: ${{ inputs.oci-target }}
Expand All @@ -67,4 +67,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Push artifacthub files to artifacthub branch
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
10 changes: 5 additions & 5 deletions .github/workflows/reusable-release-policy-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- uses: actions/checkout@v4
with:
# until https://github.com/actions/checkout/pull/579 is released
Expand All @@ -42,16 +42,16 @@ jobs:
- name: Check that artifacthub-pkg.yml is up-to-date
# skip when releasing :latest from main, versions will not match
if: startsWith(github.ref, 'refs/tags/v') && inputs.artifacthub
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
version: ${{ steps.calculate-version.outputs.version }}
- name: Build and annotate policy
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- name: Run e2e tests
run: |
make e2e-tests
- name: Release
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
oci-target: ${{ inputs.oci-target }}
Expand All @@ -67,4 +67,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Push artifacthub files to artifacthub branch
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
10 changes: 5 additions & 5 deletions .github/workflows/reusable-release-policy-rego.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- uses: actions/checkout@v4
with:
# until https://github.com/actions/checkout/pull/579 is released
Expand Down Expand Up @@ -60,12 +60,12 @@ jobs:
- name: Check that artifacthub-pkg.yml is up-to-date
# skip when releasing :latest from main, versions will not match
if: ${{ inputs.artifacthub && ( ! startsWith(github.ref, 'refs/heads/') ) }}
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
version: ${{ steps.calculate-version.outputs.version }}
policy-working-dir: ${{ inputs.policy-working-dir }}
- name: Install opa
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- uses: actions/checkout@v4
- name: Build policy
working-directory: ${{ inputs.policy-working-dir }}
Expand All @@ -83,7 +83,7 @@ jobs:
run: |
make e2e-tests
- name: Release
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
oci-target: ${{ inputs.oci-target }}
Expand All @@ -100,6 +100,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Push artifacthub files to artifacthub branch
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
policy-working-dir: ${{ inputs.policy-working-dir }}
10 changes: 5 additions & 5 deletions .github/workflows/reusable-release-policy-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- uses: actions/checkout@v4
with:
# until https://github.com/actions/checkout/pull/579 is released
Expand All @@ -42,16 +42,16 @@ jobs:
- name: Check that artifacthub-pkg.yml is up-to-date
# skip when releasing :latest from main, versions will not match
if: startsWith(github.ref, 'refs/tags/v') && inputs.artifacthub
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
version: ${{ steps.calculate-version.outputs.version }}
- name: Build and annotate policy
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- name: Run e2e tests
run: |
make e2e-tests
- name: Release
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
oci-target: ${{ inputs.oci-target }}
Expand All @@ -67,4 +67,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Push artifacthub files to artifacthub branch
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
8 changes: 4 additions & 4 deletions .github/workflows/reusable-release-policy-swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- uses: actions/checkout@v4
with:
# until https://github.com/actions/checkout/pull/579 is released
Expand All @@ -42,7 +42,7 @@ jobs:
- name: Check that artifacthub-pkg.yml is up-to-date
# skip when releasing :latest from main, versions will not match
if: startsWith(github.ref, 'refs/tags/v') && inputs.artifacthub
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
version: ${{ steps.calculate-version.outputs.version }}
- name: install wasm-strip
Expand All @@ -68,7 +68,7 @@ jobs:
run: |
make e2e-tests
- name: Release
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
oci-target: ${{ inputs.oci-target }}
Expand All @@ -84,4 +84,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Push artifacthub files to artifacthub branch
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
4 changes: 2 additions & 2 deletions .github/workflows/reusable-test-policy-assemblyscript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
# until https://github.com/actions/checkout/pull/579 is released
fetch-depth: 0
- name: Install kwctl
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- id: calculate-version
shell: bash
run: |
Expand All @@ -54,7 +54,7 @@ jobs:
fi
echo "version=$version" >> $GITHUB_OUTPUT
- name: Check that artifacthub-pkg.yml is up-to-date
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
version: ${{ steps.calculate-version.outputs.version }}
check_version: false # must match a git tag that hasn't been created yet, so let's ignore until then
8 changes: 4 additions & 4 deletions .github/workflows/reusable-test-policy-go-wasi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install dependencies
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- name: Build and annotate policy
with:
generate-sbom: false
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- name: Run e2e tests
run: make e2e-tests

Expand All @@ -58,7 +58,7 @@ jobs:
# until https://github.com/actions/checkout/pull/579 is released
fetch-depth: 0
- name: Install kwctl
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- id: calculate-version
shell: bash
run: |
Expand All @@ -77,7 +77,7 @@ jobs:
fi
echo "version=$version" >> $GITHUB_OUTPUT
- name: Check that artifacthub-pkg.yml is up-to-date
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
version: ${{ steps.calculate-version.outputs.version }}
check_version: false # must match a git tag that hasn't been created yet, so let's ignore until then
8 changes: 4 additions & 4 deletions .github/workflows/reusable-test-policy-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install dependencies
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- name: Build and annotate policy
with:
generate-sbom: false
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- name: Run e2e tests
run: make e2e-tests

Expand All @@ -58,7 +58,7 @@ jobs:
# until https://github.com/actions/checkout/pull/579 is released
fetch-depth: 0
- name: Install kwctl
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- id: calculate-version
shell: bash
run: |
Expand All @@ -77,7 +77,7 @@ jobs:
fi
echo "version=$version" >> $GITHUB_OUTPUT
- name: Check that artifacthub-pkg.yml is up-to-date
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
version: ${{ steps.calculate-version.outputs.version }}
check_version: false # must match a git tag that hasn't been created yet, so let's ignore until then
6 changes: 3 additions & 3 deletions .github/workflows/reusable-test-policy-rego.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install opa
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- name: Run unit tests
working-directory: ${{ inputs.policy-working-dir }}
run: make test
Expand All @@ -42,7 +42,7 @@ jobs:
# until https://github.com/actions/checkout/pull/579 is released
fetch-depth: 0
- name: Install kwctl
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- id: calculate-version
shell: bash
run: |
Expand All @@ -69,7 +69,7 @@ jobs:
- name: Check that artifacthub-pkg.yml is up-to-date
# only makes sense to run this check if artifacthub-pkg.yml has been
# updated for an upcoming release.
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
version: ${{ steps.calculate-version.outputs.version }}
check_version: false # must match a git tag that hasn't been created yet, so let's ignore until then
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/reusable-test-policy-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,29 @@ jobs:
# until https://github.com/actions/checkout/pull/579 is released
fetch-depth: 0
- name: Install kwctl
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- id: calculate-version
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: echo "version=$(sed -n 's,^version = \"\(.*\)\",\1,p' Cargo.toml)" >> $GITHUB_OUTPUT
shell: bash
run: |
if [ ${{ startsWith(github.ref, 'refs/tags/v') }} == true ]; then
# Triggered via normal tag.
# Use the latest tag (e.g: v0.1.11) without the `v` prefix.
version=$(git describe --tags --abbrev=0 | cut -c2-)
else
# Triggered via branch, version is not checked in artifacthub.
# Still, `make artifacthub-pkg.yml` needs a proper semver string.
#
# Use most recent tag with the number of additional commits on top
# of the tagged object & last commit hash (eg. v0.1.11-3-g8a36322),
# without the `v` prefix.
version=$(git describe --tags | cut -c2-)
fi
echo "version=$version" >> $GITHUB_OUTPUT
- name: Check that artifacthub-pkg.yml is up-to-date
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
version: ${{ steps.calculate-version.outputs.version }}
check_version: false # must match a git tag that hasn't been created yet, so let's ignore until then
check:
name: Cargo check
runs-on: ubuntu-latest
Expand Down Expand Up @@ -76,11 +90,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install dependencies
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- name: Build and annotate policy
with:
generate-sbom: false
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- name: Run e2e tests
run: |
make e2e-tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-test-policy-swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# until https://github.com/actions/checkout/pull/579 is released
fetch-depth: 0
- name: Install kwctl
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
- id: calculate-version
shell: bash
run: |
Expand All @@ -48,7 +48,7 @@ jobs:
fi
echo "version=$version" >> $GITHUB_OUTPUT
- name: Check that artifacthub-pkg.yml is up-to-date
uses: kubewarden/github-actions/[email protected].0
uses: kubewarden/github-actions/[email protected].1
with:
version: ${{ steps.calculate-version.outputs.version }}
check_version: false # must match a git tag that hasn't been created yet, so let's ignore until then
Loading

0 comments on commit 588eb8b

Please sign in to comment.