Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/__check_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ jobs:
name: Check pull request
uses: $/.github/workflows/check_python_package_pr.yaml
permissions: {}
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/__lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ jobs:
uses: $/.github/workflows/lint_workflows.yaml
permissions:
contents: read
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/__release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ jobs:
RELEASE_TAG: ${{ steps.create-tag.outputs.tag }}
permissions:
contents: write # Needed to create release
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/_mirror_charm.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
token: ${{ secrets.MIRROR_REPOS_PAT }}
permissions:
contents: read
cache-mode: none
```

Add `MIRROR_REPOS_PAT` as an environment secret for the `mirror-repos` environment: https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets#creating-secrets-for-an-environment. **Do not** add it as a repository secret.
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/_mirror_charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ jobs:
VAR_REPOSITORY: ${{ inputs.repository }}
permissions:
contents: read
cache-mode: none
2 changes: 2 additions & 0 deletions .github/workflows/_promote_charm_legacy_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN_PROMOTION }}
permissions:
contents: write # Needed to edit GitHub releases
cache-mode: none
```
### Step 2: Add `check_pr.yaml` file to `.github/workflows/`
```yaml
Expand All @@ -69,6 +70,7 @@ jobs:
name: Check pull request
uses: canonical/data-platform-workflows/.github/workflows/check_charm_pr.yaml@v0.0.0
permissions: {}
cache-mode: none
```
Update `branches` to include all branches that [`release_charm_edge.yaml`](release_charm_edge.md) runs on

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/_promote_charm_legacy_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,4 @@ jobs:
run: cat ~/.local/state/charmcraft/log/*
permissions:
contents: write # Needed to edit GitHub releases
cache-mode: none
2 changes: 2 additions & 0 deletions .github/workflows/_promote_charms.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN_PROMOTION }}
permissions:
contents: write # Needed to edit GitHub releases
cache-mode: none
```

### Step 2: Add `check_pr.yaml` file to `.github/workflows/`
Expand All @@ -70,6 +71,7 @@ jobs:
name: Check pull request
uses: canonical/data-platform-workflows/.github/workflows/check_charm_pr.yaml@v0.0.0
permissions: {}
cache-mode: none
```
Update `branches` to include all branches that [`release_charm_edge.yaml`](release_charm_edge.md) runs on

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/_promote_charms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ jobs:
run: cat ~/.local/state/charmcraft/log/*
permissions:
contents: write # Needed to edit GitHub releases
cache-mode: none
2 changes: 2 additions & 0 deletions .github/workflows/_promote_charms_legacy_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN_PROMOTION }}
permissions:
contents: write # Needed to edit GitHub releases
cache-mode: none
```
### Step 2: Add `check_pr.yaml` file to `.github/workflows/`
```yaml
Expand All @@ -70,6 +71,7 @@ jobs:
name: Check pull request
uses: canonical/data-platform-workflows/.github/workflows/check_charm_pr.yaml@v0.0.0
permissions: {}
cache-mode: none
```
Update `branches` to include all branches that [`release_charm_edge.yaml`](release_charm_edge.md) runs on

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/_promote_charms_legacy_2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ jobs:
run: cat ~/.local/state/charmcraft/log/*
permissions:
contents: write # Needed to edit GitHub releases
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/_promote_snaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
snapcraft-token: ${{ secrets.SNAPCRAFT_TOKEN }}
permissions:
contents: write # Needed to edit GitHub releases
cache-mode: none
```

### Step 2: Add `.github/release.yaml` file
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/_promote_snaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ jobs:
run: cat ~/.local/state/snapcraft/log/*
permissions:
contents: write # Needed to edit GitHub releases
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/_update_bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
permissions:
contents: write # Needed to push branch
pull-requests: write # Needed to create PR
cache-mode: none
```

Add `CREATE_PR_APP_TOKEN` as an environment secret for the `update-bundle` environment: https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets#creating-secrets-for-an-environment. **Do not** add it as a repository secret.
1 change: 1 addition & 0 deletions .github/workflows/_update_bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,4 @@ jobs:
permissions:
contents: write # Needed to push branch
pull-requests: write # Needed to create PR
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/approve_renovate_pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/approve_renovate_pr.yaml@v0.0.0
permissions:
pull-requests: write # Needed to approve PR
cache-mode: none
```
1 change: 1 addition & 0 deletions .github/workflows/approve_renovate_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ jobs:
VAR_PR_NUMBER: ${{ github.event.pull_request.number }}
permissions:
pull-requests: write # Needed to approve PR
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/build_charm.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v0.0.0
permissions:
contents: read
cache-mode: none
```

Unless you disable caching (with `cache: false`), remember to add your charm's branch(es) to charmcraftcache: https://github.com/canonical/charmcraftcache?tab=readme-ov-file#usage
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
platforms: ${{ steps.collect.outputs.platforms }}
permissions:
contents: read
cache-mode: none

build:
strategy:
Expand Down Expand Up @@ -185,3 +186,4 @@ jobs:
if-no-files-found: error
permissions:
contents: read
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/build_rock.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/build_rock.yaml@v0.0.0
permissions:
contents: read
cache-mode: none
```

### Supported `platforms` syntax in rockcraft.yaml
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_rock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
platforms: ${{ steps.collect.outputs.platforms }}
permissions:
contents: read
cache-mode: none

build:
strategy:
Expand Down Expand Up @@ -164,3 +165,4 @@ jobs:
if-no-files-found: error
permissions:
contents: read
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/build_snap.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/build_snap.yaml@v0.0.0
permissions:
contents: read
cache-mode: none
```

### Supported `platforms` and `architectures` syntax in snapcraft.yaml
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
platforms: ${{ steps.collect.outputs.platforms }}
permissions:
contents: read
cache-mode: none

build:
strategy:
Expand Down Expand Up @@ -173,3 +174,4 @@ jobs:
if-no-files-found: error
permissions:
contents: read
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/check_charm_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ jobs:
env:
LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
permissions: {}
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/check_python_package_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ jobs:
env:
TITLE: ${{ github.event.pull_request.title }}
permissions: {}
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/lint_workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/lint_workflows.yaml@v0.0.0
permissions:
contents: read
cache-mode: none
```

### Step 2: Add `.github/zizmor.yaml` file
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint_workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ jobs:
run: zizmor .
permissions:
contents: read
cache-mode: none
3 changes: 3 additions & 0 deletions .github/workflows/release_charm_edge.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
track: 'latest'
permissions:
contents: write # Needed to create git tag
cache-mode: none

build:
name: Build charm
Expand All @@ -30,6 +31,7 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v0.0.0
permissions:
contents: read
cache-mode: none

release:
name: Release charm
Expand All @@ -44,6 +46,7 @@ jobs:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN_EDGE }}
permissions:
contents: write # Needed to create git tags
cache-mode: none
```

### Step 2: Add Charmhub token
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_charm_edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,4 @@ jobs:
run: cat ~/.local/state/charmcraft/log/*
permissions:
contents: write # Needed to create git tags
cache-mode: none
2 changes: 2 additions & 0 deletions .github/workflows/release_charm_pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v0.0.0
permissions:
contents: read
cache-mode: none

release:
name: Release charm to Charmhub branch
Expand All @@ -27,6 +28,7 @@ jobs:
charmhub-token: ${{ secrets.CHARMHUB_TOKEN_EDGE_PR }}
permissions:
contents: read
cache-mode: none
```

### Step 2: Add Charmhub token
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_charm_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,4 @@ jobs:
run: cat ~/.local/state/charmcraft/log/*
permissions:
contents: read
cache-mode: none
4 changes: 4 additions & 0 deletions .github/workflows/release_python_package.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/release_python_package_part1.yaml@v0.0.0
permissions:
contents: write # Needed to create git tag
cache-mode: none

# Separate job needed to workaround https://github.com/pypi/warehouse/issues/11096
release-trusted-publishing:
Expand All @@ -66,6 +67,7 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
permissions:
id-token: write # Needed for PyPI trusted publishing
cache-mode: none

release-part2:
name: Release to PyPI (part 2)
Expand All @@ -77,6 +79,7 @@ jobs:
git-tag: ${{ needs.release-part1.outputs.git-tag }}
permissions:
contents: write # Needed to create GitHub release
cache-mode: none
```

### Step 3: Add `check_pr.yaml` file to `.github/workflows/`
Expand All @@ -98,6 +101,7 @@ jobs:
name: Check pull request
uses: canonical/data-platform-workflows/.github/workflows/check_python_package_pr.yaml@v0.0.0
permissions: {}
cache-mode: none
```

### Step 4: Configure GitHub repository settings
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release_python_package_part1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ jobs:
tag: ${{ steps.create-tag.outputs.tag }}
permissions:
contents: write # Needed to create git tag

cache-mode: none

build:
name: Build package
needs:
Expand All @@ -56,3 +57,4 @@ jobs:
path: dist/
permissions:
contents: read
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/release_python_package_part2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ jobs:
VAR_LATEST: ${{ case(github.ref_name == github.event.repository.default_branch && startsWith(github.ref, 'refs/heads/'), '--latest', '--latest=false') }}
permissions:
contents: write # Needed to create GitHub release
cache-mode: none
2 changes: 2 additions & 0 deletions .github/workflows/release_rock_edge.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/build_rock.yaml@v0.0.0
permissions:
contents: read
cache-mode: none

release:
name: Release rock
Expand All @@ -33,6 +34,7 @@ jobs:
permissions:
packages: write # Needed to publish to GitHub Container Registry
contents: write # Needed to create git tags
cache-mode: none
```

Grant package `Write` role to GitHub Actions for the source GitHub repository: https://docs.github.com/en/packages/learn-github-packages/configuring-a-packages-access-control-and-visibility#ensuring-workflow-access-to-your-package
1 change: 1 addition & 0 deletions .github/workflows/release_rock_edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ jobs:
permissions:
packages: write # Needed to publish to GitHub Container Registry
contents: write # Needed to create git tags
cache-mode: none
2 changes: 2 additions & 0 deletions .github/workflows/release_snap_edge.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/build_snap.yaml@v0.0.0
permissions:
contents: read
cache-mode: none

release:
name: Release snap
Expand All @@ -35,6 +36,7 @@ jobs:
snap-store-token: ${{ secrets.SNAP_STORE_TOKEN_EDGE }}
permissions:
contents: write # Needed to create git tags
cache-mode: none
```

### Step 2: Add Snap Store token
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_snap_edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,4 @@ jobs:
run: cat ~/.local/state/snapcraft/log/*
permissions:
contents: write # Needed to create git tags
cache-mode: none
2 changes: 2 additions & 0 deletions .github/workflows/release_snap_pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/build_snap.yaml@v0.0.0
permissions:
contents: read
cache-mode: none

release:
name: Release snap to Snap Store branch
Expand All @@ -27,6 +28,7 @@ jobs:
snap-store-token: ${{ secrets.SNAP_STORE_TOKEN_EDGE_PR }}
permissions:
contents: read
cache-mode: none
```

### Step 2: Add Snap Store token
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_snap_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,4 @@ jobs:
run: cat ~/.local/state/snapcraft/log/*
permissions:
contents: read
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/sync_docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
permissions:
contents: write # Needed to push branch & tag
pull-requests: write # Needed to create PR
cache-mode: none
```

### metadata.yaml required
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sync_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ jobs:
permissions:
contents: write # Needed to push branch & tag
pull-requests: write # Needed to create PR
cache-mode: none
1 change: 1 addition & 0 deletions .github/workflows/tag_charm_edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ jobs:
VAR_TRACK: ${{ inputs.track }}
permissions:
contents: write # Needed to create git tag
cache-mode: none