Skip to content

CI(deps): Update ruff to v0.17.3 (main) #7382

CI(deps): Update ruff to v0.17.3 (main)

CI(deps): Update ruff to v0.17.3 (main) #7382

---
name: Create or check a release draft
on:
push:
branches:
- main
- releasebranch_*
tags:
- '**'
pull_request:
paths:
- .github/**
- utils/**
concurrency:
group: >-
${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
OUT_DIR: ${{ github.workspace }}/../grass_outdir
GRASS: grass-${{ github.ref_name }}
permissions: {}
jobs:
build:
name: Package and create release draft
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checks-out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.ref }}
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.14'
- name: Create output directory
run: |
mkdir "${OUT_DIR}"
- name: Generate ChangeLog file
run: |
python utils/gitlog2changelog.py
mv ChangeLog "${OUT_DIR}/ChangeLog"
gzip "${OUT_DIR}/ChangeLog"
- name: Generate Git derived data files
run: |
echo "Generate VERSION_GIT file:"
./utils/generate_version_git_file.sh
cat include/VERSION_GIT
echo "Generate GENERATE_LAST_COMMIT_FILE:"
python utils/generate_last_commit_file.py .
cat core_modules_with_last_commit.json
echo "Create core modules patch file:"
git add core_modules_with_last_commit.json
git diff --cached > \
"${OUT_DIR}/core_modules_with_last_commit.patch"
- name: Create tarballs (for tags only)
if: startsWith(github.ref, 'refs/tags/')
run: |
cd ..
tar -cvf "${OUT_DIR}/${GRASS}.tar" \
--exclude=".gi*" --exclude=".tr*" \
--transform s/grass/"${GRASS}"/ grass
cd "${OUT_DIR}" || exit
gzip -9k "${GRASS}.tar"
md5sum "${GRASS}.tar.gz" > "${GRASS}.tar.gz.md5"
sha256sum "${GRASS}.tar.gz" > "${GRASS}.tar.gz.sha256"
xz -9e "${GRASS}.tar"
md5sum "${GRASS}.tar.xz" > "${GRASS}.tar.xz.md5"
sha256sum "${GRASS}.tar.xz" > "${GRASS}.tar.xz.sha256"
- name: Publish draft distribution to GitHub (for tags only)
if: startsWith(github.ref, 'refs/tags/')
run: |-
gh release create "${GITHUB_REF_NAME}" \
--draft \
--verify-tag \
--fail-on-no-commits \
--generate-notes \
--title "${TITLE}" \
--prerelease="${PRERELEASE_FLAG}" \
"${OUT_DIR}/${GRASS}.tar.gz" \
"${OUT_DIR}/${GRASS}.tar.gz.md5" \
"${OUT_DIR}/${GRASS}.tar.gz.sha256" \
"${OUT_DIR}/${GRASS}.tar.xz" \
"${OUT_DIR}/${GRASS}.tar.xz.md5" \
"${OUT_DIR}/${GRASS}.tar.xz.sha256" \
"${OUT_DIR}/ChangeLog.gz" \
"${OUT_DIR}/core_modules_with_last_commit.patch"
env:
GH_TOKEN: ${{ github.token }}
TITLE: GRASS ${{ github.ref_name }}
PRERELEASE_FLAG: ${{ contains(github.ref, 'RC') }}