Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
name: CI/CD

permissions: {}

on:
pull_request:
workflow_dispatch:
push:
branches: ["main"]

jobs:
zizmor:
name: zizmor
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Run zizmor
uses: zizmorcore/zizmor-action@53290badfa369cb0bf7ad16342cb62c2fa47ac7b # v0.8.0
with:
advanced-security: false # Fail the job on findings instead of uploading SARIF.
annotations: true

ci:
name: CI
runs-on: ubuntu-latest
Expand All @@ -15,10 +32,12 @@ jobs:
version: [17, 21, 25]
steps:
- name: Checkout
uses: actions/checkout@v7.0.1

uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Install java
uses: actions/setup-java@v6.2.0
uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0
with:
distribution: 'temurin'
java-version: '${{ matrix.version }}'
Expand All @@ -43,16 +62,17 @@ jobs:
name: CD
runs-on: ubuntu-latest
if: ${{ github.ref_name == 'main' }}
needs: [ci]
needs: [ci, zizmor]
permissions:
contents: write
actions: write
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# we need to fetch all existing git tags
fetch-depth: 0
# Required to push release tags from scripts/publish.sh.
persist-credentials: true

- name: Create git tags and publish to Maven Central
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: |
curl -sSL -o remote-labeler.yml https://raw.githubusercontent.com/stackitcloud/stackit-sdk-go/main/.github/labeler.yml
- name: Labeler action
uses: actions/labeler@v7.0.0
uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
with:
configuration-path: "remote-labeler.yml"
sync-labels: false
2 changes: 1 addition & 1 deletion scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ for file in $(find . -print | sed 's|^./||' | grep -E "(^services/[^/]+/VERSION$
# Tag doesn't exist. Create a tag and push it.
echo "Tag '$expected_tag' does not exist."
git tag -a $expected_tag -m "Release $version"
git push origin tag $expected_tag
git push origin tag "$expected_tag"

./gradlew "${gradle_subproject}:publishToMavenCentral"
fi
Expand Down
Loading