-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (33 loc) · 1.02 KB
/
test-release.yaml
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
---
name: Create Test Release (0.0.0) from PR Branch
on:
pull_request:
branches:
- master
paths:
- src/**
jobs:
set-test-release-and-tag:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Delete and recreate release
env:
GITHUB_TOKEN: ${{ secrets.MINITRINO_TOKEN }}
run: |-
TAG="0.0.0"
DESCRIPTION="Used as a placeholder to give test builds access \
to the PR branch's module library."
echo "Checking if release exists..."
if gh release list | grep -q -e "${TAG}"; then
echo "Release ${TAG} found. Deleting release..."
gh release delete "${TAG}" -y --cleanup-tag
fi
echo "Creating test release from branch ${GITHUB_HEAD_REF}..."
gh release create "${TAG}" \
--prerelease \
--draft=false \
--title "${TAG}" \
--notes "${DESCRIPTION}" \
--target "${GITHUB_HEAD_REF}"