Skip to content

Commit

Permalink
✨ add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ctcpip committed Sep 26, 2023
1 parent e42829d commit 001edb8
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# prevent all files from being included in release archives
* export-ignore
meetings export-ignore
scripts export-ignore
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: release

on:
push:
branches:
- main
paths:
- meetings/**

jobs:
build:
runs-on: ubuntu-latest
steps:
- id: files
name: get changed files
uses: jitterbit/get-changed-files@v1
with:
format: 'json'
- run: |
readarray -t added_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.added }}')"
for added_file in "${added_files[@]}"; do
if [[ ${added_file} == meetings/* ]]
then
tag=$(echo "${added_file}" | grep -oP '(?<=meetings/)[^\./]+')
echo "tag=${tag}" >> "$GITHUB_ENV" # set GH env var so other action can access it
echo tag set to "${tag}"
break
fi
done
- name: checkout
uses: actions/checkout@v3
- name: release
run: |
git fetch --depth=1 --tags
if [[ $(git tag -l "${{env.tag}}") ]]
then
echo "release exists; skipping"
else
gh release create "${{env.tag}}"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 001edb8

Please sign in to comment.