-
Notifications
You must be signed in to change notification settings - Fork 4
40 lines (35 loc) · 1.05 KB
/
auto-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Auto Release
on:
workflow_run:
workflows: ["Create Release ZIP"]
types:
- completed
branches:
- main
jobs:
create-release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Find latest zip file
id: find-zip
run: |
LATEST_ZIP=$(ls -t releases/*.zip | head -n 1)
echo "zip_file=$LATEST_ZIP" >> $GITHUB_OUTPUT
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
file="${{ steps.find-zip.outputs.zip_file }}"
# 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"