-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.58 KB
/
Copy pathrelease.yml
File metadata and controls
55 lines (46 loc) · 1.58 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Create Release
on:
workflow_run:
workflows: ["Tests"]
types:
- completed
workflow_dispatch:
jobs:
release:
if: >
github.event_name == 'workflow_dispatch' ||
startsWith(github.event.workflow_run.head_branch, 'v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
- name: Prepare and Archive Sources
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG_NAME="${GITHUB_REF##*/}"
else
TAG_NAME="${{ github.event.workflow_run.head_branch }}"
fi
if [ -z "$TAG_NAME" ]; then
TAG_NAME="latest"
fi
VERSION=${TAG_NAME#v}
echo "Tag name: $TAG_NAME"
echo "Version to use: $VERSION"
mkdir -p fcfTest
cp -R [A-Za-z0-9]* fcfTest/ 2>/dev/null || true
rm -rf fcfTest/fcfTest fcfTest/.git fcfTest/.github
7z a -tzip "fcfTest-${VERSION}.zip" fcfTest/
echo "ARCHIVE_NAME=fcfTest-${VERSION}.zip" >> $GITHUB_ENV
echo "CLEAN_TAG=$TAG_NAME" >> $GITHUB_ENV
- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.CLEAN_TAG }}
target_commitish: ${{ github.event.workflow_run.head_sha || github.sha }}
generate_release_notes: true
files: ${{ env.ARCHIVE_NAME }}