Skip to content

Commit

Permalink
Merge pull request #83 from richardadonnell/1.49
Browse files Browse the repository at this point in the history
Create auto-release.yml
  • Loading branch information
richardadonnell authored Nov 24, 2024
2 parents 6d5a478 + f8c6094 commit 16e58a7
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Auto Release

on:
push:
paths:
- 'releases/*.zip'

jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
with:
files: releases/*.zip

- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
if [[ $file == releases/*.zip ]]; then
# Extract version from filename (assuming format: upwork-job-scraper-X.XX.zip)
VERSION=$(echo "$file" | sed -n 's/.*-\([0-9.]*\)\.zip$/\1/p')
FILENAME=$(basename "$file")
# Create and publish release
gh release create "$VERSION" \
--title "$FILENAME" \
--notes "" \
"$file"
fi
done

0 comments on commit 16e58a7

Please sign in to comment.