Skip to content

Update pypa/gh-action-pypi-publish action to v1.14.2 (#577) #638

Update pypa/gh-action-pypi-publish action to v1.14.2 (#577)

Update pypa/gh-action-pypi-publish action to v1.14.2 (#577) #638

Workflow file for this run

name: GitHub Release
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- "trunk"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
env:
name: gsd
defaults:
run:
shell: bash
jobs:
release:
name: Build release tarball
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
submodules: true
path: code
- name: Install tools
run: sudo apt-get install pcregrep pandoc
- name: Determine last tag via git describe
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
run: echo tag="$(git describe --abbrev=0)" >> "$GITHUB_ENV"
working-directory: code
# git describe does not return the current tag in tag pushes on GitHub Actions, use GITHUB_REF instead
- name: Determine tag from GITHUB_REF
if: startsWith(github.ref, 'refs/tags/v')
run: echo tag="$(echo "${GITHUB_REF}" | sed -e 's/refs\/tags\///g')" >> "$GITHUB_ENV"
- name: Write version change log
run: .github/workflows/make-changelog-md.sh "${tag:1}" | tee "${GITHUB_WORKSPACE}/changelog.md"
working-directory: code
- name: Copy source
run: cp -R code "${name}-${tag:1}"
- name: Remove .git
run: rm -rf "${name}-${tag:1}/.git" && ls -laR "${name}-${tag:1}"
- name: Tar source (gzip)
run: tar -cvzf "${name}-${tag:1}.tar.gz" "${name}-${tag:1}"
- name: Tar source (xzip)
run: tar -cvJf "${name}-${tag:1}.tar.xz" "${name}-${tag:1}"
- name: Tar source (zstd)
run: tar -cv "${name}-${tag:1}" | zstd -19 -T0 -o "${name}-${tag:1}.tar.zst"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: release
path: |
*.tar.*
changelog.md
check:
name: Check [GitHub]
needs: [release]
runs-on: ubuntu-24.04
steps:
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: release
- name: Check files
run: ls -lR
publish:
name: Publish [GitHub]
if: startsWith(github.ref, 'refs/tags/')
needs: [release]
runs-on: ubuntu-24.04
environment: release
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: release
- name: Create release
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3
if: startsWith(github.ref, 'refs/tags/v')
with:
files: "*.tar.*"
body_path: changelog.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}