feat: rename
This commit is contained in:
parent
0989068ef1
commit
9db47b20e7
2 changed files with 3 additions and 6 deletions
57
.github/workflows/release-check.yml
vendored
Normal file
57
.github/workflows/release-check.yml
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
name: Daily Release Check
|
||||||
|
|
||||||
|
on:
|
||||||
|
# Allow manual trigger for testing
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
prepare:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
last_release: ${{ steps.last-release.outputs.hash }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Find package directories
|
||||||
|
id: set-matrix
|
||||||
|
run: |
|
||||||
|
DIRS=$(git ls-tree -r HEAD --name-only | grep -E "package.json|pyproject.toml" | xargs dirname | grep -v "^.$" | jq -R -s -c 'split("\n")[:-1]')
|
||||||
|
echo "matrix=${DIRS}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Get last release hash
|
||||||
|
id: last-release
|
||||||
|
run: |
|
||||||
|
HASH=$(git rev-list --tags --max-count=1 || echo "HEAD~1")
|
||||||
|
echo "hash=${HASH}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
check-release:
|
||||||
|
needs: prepare
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
directory: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
||||||
|
fail-fast: false
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- uses: astral-sh/setup-uv@v5
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
if: endsWith(matrix.directory, 'package.json')
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '18'
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
if: endsWith(matrix.directory, 'pyproject.toml')
|
||||||
|
run: uv python install
|
||||||
|
|
||||||
|
- name: Check release
|
||||||
|
run: |
|
||||||
|
uv run --script scripts/release.py --dry-run "${{ matrix.directory }}" "${{ needs.prepare.outputs.last_release }}"
|
||||||
102
.github/workflows/release.yml
vendored
Normal file
102
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,102 @@
|
||||||
|
name: Daily Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# Run every day at 9:00 UTC
|
||||||
|
- cron: '0 9 * * *'
|
||||||
|
# Allow manual trigger for testing
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
prepare:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
last_release: ${{ steps.last-release.outputs.hash }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Find package directories
|
||||||
|
id: set-matrix
|
||||||
|
run: |
|
||||||
|
DIRS=$(git ls-tree -r HEAD --name-only | grep -E "package.json|pyproject.toml" | xargs dirname | grep -v "^.$" | jq -R -s -c 'split("\n")[:-1]')
|
||||||
|
echo "matrix=${DIRS}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Get last release hash
|
||||||
|
id: last-release
|
||||||
|
run: |
|
||||||
|
HASH=$(git rev-list --tags --max-count=1 || echo "HEAD~1")
|
||||||
|
echo "hash=${HASH}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
release:
|
||||||
|
needs: prepare
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
directory: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
||||||
|
fail-fast: false
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- uses: astral-sh/setup-uv@v5
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
if: endsWith(matrix.directory, 'package.json')
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '18'
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
if: endsWith(matrix.directory, 'pyproject.toml')
|
||||||
|
run: uv python install
|
||||||
|
|
||||||
|
- name: Release package
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
||||||
|
run: uv run --script scripts/release.py "${{ matrix.directory }}" "${{ needs.prepare.outputs.last_release }}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
create-release:
|
||||||
|
needs: [prepare, release]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
# Check if there's output from release step
|
||||||
|
if [ -s "$GITHUB_OUTPUT" ]; then
|
||||||
|
DATE=$(date +%Y.%m.%d)
|
||||||
|
|
||||||
|
# Create git tag
|
||||||
|
git tag -s -a -m"automated release v${DATE}" "v${DATE}"
|
||||||
|
git push origin "v${DATE}"
|
||||||
|
|
||||||
|
# Create release notes
|
||||||
|
echo "# Release ${DATE}" > notes.md
|
||||||
|
echo "" >> notes.md
|
||||||
|
echo "## Updated Packages" >> notes.md
|
||||||
|
|
||||||
|
# Read updated packages from github output
|
||||||
|
while IFS= read -r line; do
|
||||||
|
echo "- ${line}" >> notes.md
|
||||||
|
done < "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# Create GitHub release
|
||||||
|
gh release create "v${DATE}" \
|
||||||
|
--title "Release ${DATE}" \
|
||||||
|
--notes-file notes.md
|
||||||
|
fi
|
||||||
Loading…
Reference in a new issue