mirror of
https://github.com/github/gitignore.git
synced 2026-08-28 02:37:29 +02:00
Add GitHub Actions workflow for release process
This commit is contained in:
parent
dcc0fc7bc2
commit
949a86d7dc
40
.github/workflows/release.yml
vendored
Normal file
40
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, release ]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out tagged revision
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
OUTPUT="$GITHUB_SHA:.gitignore_global"
|
||||
OUTPUT_PATH="$GITHUB_WORKSPACE/$OUTPUT"
|
||||
|
||||
> "$OUTPUT_PATH"
|
||||
|
||||
while IFS= read -r -d '' file; do
|
||||
echo "# === $file ===" >> "$OUTPUT_PATH"
|
||||
cat "$file" >> "$OUTPUT_PATH"
|
||||
echo >> "$OUTPUT_PATH"
|
||||
done < <(find "$GITHUB_WORKSPACE" -name "*.gitignore" ! -path "$OUTPUT_PATH" -print0 | sort -z)
|
||||
|
||||
- name: Create GitHub release
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: >-
|
||||
gh release create "$GITHUB_REF_NAME" "$GITHUB_WORKSPACE/$GITHUB_SHA:.gitignore_global"
|
||||
--repo "$GITHUB_REPOSITORY"
|
||||
--title "$GITHUB_REF_NAME"
|
||||
--generate-notes
|
||||
--verify-tag
|
||||
Loading…
Reference in New Issue
Block a user