74 lines
1.8 KiB
YAML
74 lines
1.8 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
|
|
jobs:
|
|
validate:
|
|
name: Validate
|
|
uses: ./.github/workflows/validate.yml
|
|
permissions:
|
|
contents: read
|
|
|
|
package:
|
|
name: Package
|
|
needs: validate
|
|
runs-on: linux-amd64-docker-small
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25.x'
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Verify tag matches the snapshot
|
|
run: |
|
|
python - <<'PY'
|
|
import json
|
|
import os
|
|
|
|
with open("gitea.lock.json", encoding="utf-8") as lock_file:
|
|
lock = json.load(lock_file)
|
|
assert lock["tag"] == os.environ["GITHUB_REF_NAME"], (
|
|
"Release tag must match the pinned Gitea tag"
|
|
)
|
|
PY
|
|
|
|
- name: Generate preview
|
|
working-directory: tools
|
|
run: go run . preview all
|
|
|
|
- name: Package themes and preview
|
|
run: python -B .github/scripts/package_release.py --version "$TEMPLATE_RELEASE"
|
|
env:
|
|
TEMPLATE_RELEASE: ${{ github.ref_name }}
|
|
|
|
- name: Prepare release runtime
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Release
|
|
uses: actions/gitea-release-action@v1.3.7
|
|
with:
|
|
server_url: ${{ github.server_url }}
|
|
repository: ${{ github.repository }}
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
name: ${{ github.ref_name }}
|
|
tag_name: ${{ github.ref_name }}
|
|
body: ''
|
|
draft: false
|
|
prerelease: false
|
|
files: |
|
|
dist/gitea-mail-templates-${{ github.ref_name }}.zip
|
|
dist/gitea-mail-templates-${{ github.ref_name }}.tar.gz
|