-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.57 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Release
permissions:
contents: write
actions: read
on:
push:
branches:
- main # Or whichever branch you want to track
jobs:
build-runspace:
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Version to Todays Date
id: extract_version
run: |
$version = (Get-Date -Format "yy.MM.dd")
echo "VERSION=$version" >> $env:GITHUB_ENV
shell: pwsh
- name: Create Tag
id: create_tag
run: |
$tagExists = git tag -l $env:VERSION
if ($tagExists -eq "") {
git tag $env:VERSION
if ($LASTEXITCODE -ne 0) {
Write-Error "Failed to create tag $env:VERSION"
exit 1
}
git push origin $env:VERSION
if ($LASTEXITCODE -ne 0) {
Write-Error "Failed to push tag $env:VERSION"
exit 1
}
} else {
Write-Host "Tag $env:VERSION already exists, skipping tag creation"
}
shell: pwsh
- name: Upload st.ps1 as artifact
uses: actions/upload-artifact@v4
with:
name: shelltube
path: ./st.ps1
- name: Create and Upload Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.VERSION }}
name: Release ${{ env.VERSION }}
append_body: false
files: ./st.ps1
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}