Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f386e2570d | |||
| 3925c92fc3 | |||
| acff90b066 | |||
| 8a4003819d | |||
| c988c26746 | |||
| 74e7be819e | |||
| 8973a9f9ff | |||
| 1b8fe65eda | |||
| 72551407e7 | |||
| d9f83ca84e | |||
| 8a04fa9247 | |||
| db88e979bb | |||
| 4d70414705 |
@@ -10,12 +10,12 @@ jobs:
|
|||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Increment tag
|
- name: Increment tag
|
||||||
id: tag
|
id: tag
|
||||||
uses: https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment@0.1.2
|
uses: https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment@41b7e04221df8a033bec841d40a097b76e5f67ff # 0.1.29
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITEA_TOKEN }}
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
- name: Push tag
|
- name: Push tag
|
||||||
|
|||||||
16
.gitea/workflows/ci.yaml
Normal file
16
.gitea/workflows/ci.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test_get-repo-name:
|
||||||
|
name: Test get-repo-name
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
- id: repo
|
||||||
|
uses: ./get-repo-name
|
||||||
|
- run: |
|
||||||
|
test "${{ steps.repo.outputs.name }}" = "actions" || (echo "Expected repo name 'actions', got '${{ steps.repo.outputs.name }}'" && exit 1)
|
||||||
|
- run: echo "Original repository name is ${{ GITEA_REPOSITORY }}"
|
||||||
@@ -4,4 +4,6 @@ Collection of Gitea friendly actions.
|
|||||||
|
|
||||||
## Actions
|
## Actions
|
||||||
|
|
||||||
- [release-git-tag](./release-git-tag//README.md)
|
- [get-repo-name](./get-repo-name/README.md)
|
||||||
|
- [release-git-tag](./release-git-tag/README.md)
|
||||||
|
- [release-helm-chart](./release-helm-chart/README.md)
|
||||||
|
|||||||
11
get-repo-name/README.md
Normal file
11
get-repo-name/README.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# get-repo-name
|
||||||
|
|
||||||
|
Outputs the repository name from the Git/Gitea/GitHub environment without the owner.
|
||||||
|
|
||||||
|
Example: `t.behrendt/actions` → `actions`
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- id: repo
|
||||||
|
uses: https://gitea.t000-n.de/t.behrendt/actions/get-repo-name@0.0.0
|
||||||
|
- run: echo "Repository name is ${{ steps.repo.outputs.name }}"
|
||||||
|
```
|
||||||
16
get-repo-name/action.yaml
Normal file
16
get-repo-name/action.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: Get repo name
|
||||||
|
description: Outputs the repository name without the owner (e.g. "owner/repo" → "repo")
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
name:
|
||||||
|
description: The repository name without the owner
|
||||||
|
value: ${{ steps.repo-name.outputs.name }}
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- id: repo-name
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
REPO="${GITEA_REPOSITORY:-$GITHUB_REPOSITORY}"
|
||||||
|
echo "name=${REPO##*/}" >> $GITHUB_OUTPUT
|
||||||
23
release-helm-chart/README.md
Normal file
23
release-helm-chart/README.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# release-helm-chart
|
||||||
|
|
||||||
|
Packages and releases a Helm chart to a Gitea Helm registry.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
| Input | Description | Required |
|
||||||
|
| ------------------- | ----------------------------- | -------- |
|
||||||
|
| `tag` | The version tag to release | Yes |
|
||||||
|
| `name` | The name of the Helm chart | Yes |
|
||||||
|
| `registry-user` | The username for the registry | Yes |
|
||||||
|
| `registry-password` | The password for the registry | Yes |
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: ./release-helm-chart
|
||||||
|
with:
|
||||||
|
tag: v1.2.3
|
||||||
|
name: my-chart
|
||||||
|
registry-user: myuser
|
||||||
|
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
```
|
||||||
30
release-helm-chart/action.yaml
Normal file
30
release-helm-chart/action.yaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
name: Release Helm chart
|
||||||
|
description: Release the Helm chart
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: The tag to release
|
||||||
|
required: true
|
||||||
|
name:
|
||||||
|
description: The name of the Helm chart
|
||||||
|
required: true
|
||||||
|
registry-user:
|
||||||
|
description: The username for the registry
|
||||||
|
required: true
|
||||||
|
registry-password:
|
||||||
|
description: The password for the registry
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- shell: bash
|
||||||
|
run: |
|
||||||
|
helm package ${{ inputs.name }} --version ${{ inputs.tag }}
|
||||||
|
- shell: bash
|
||||||
|
run: |
|
||||||
|
curl --verbose --fail --show-error \
|
||||||
|
--user ${{ inputs.registry-user }}:${{ inputs.registry-password }} \
|
||||||
|
-X POST \
|
||||||
|
--upload-file ./${{ inputs.name }}-${{ inputs.tag }}.tgz \
|
||||||
|
https://gitea.t000-n.de/api/packages/${{ inputs.registry-user }}/helm/api/charts
|
||||||
Reference in New Issue
Block a user