-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (73 loc) · 2.76 KB
/
Copy pathrelease.yml
File metadata and controls
89 lines (73 loc) · 2.76 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Release
on:
push:
tags:
- v*
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Show dotnet info
run: dotnet --info
- name: Build TokenGetter Linux
run: dotnet publish SpotifyBearerTokenGetter -c Release -r linux-x64 -p:PublishSingleFile=true --self-contained true --output TelegramStatus/Publish/linux-x64/Main
- name: Build Telegram Music Status Linux
run: dotnet publish TelegramMusicStatus -c Release -r linux-x64 -p:PublishSingleFile=true --self-contained true --output TelegramStatus/Publish/linux-x64/Main/App
- name: Archive files linux
run: |
cd TelegramStatus/Publish/linux-x64
zip -r linux-x64.zip *
- name: Build TokenGetter Windows
run: dotnet publish SpotifyBearerTokenGetter -c Release -r win-x64 -p:PublishSingleFile=true --output TelegramStatus/Publish/win-x64/Main --self-contained false
- name: Build Telegram Music Status Windows
run: dotnet publish TelegramMusicStatus -c Release -r win-x64 -p:PublishSingleFile=true --output TelegramStatus/Publish/win-x64/Main/App --self-contained false
- name: Archive files windows
run: |
cd TelegramStatus/Publish/win-x64
zip -r win-x64.zip *
- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
files: |
TelegramStatus/Publish/linux-x64/linux-x64.zip
TelegramStatus/Publish/win-x64/win-x64.zip
generate_release_notes: true
deploy:
needs: build-and-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
docker.io/${{ secrets.DOCKER_USERNAME }}/telegrammusicstatus:latest
docker.io/${{ secrets.DOCKER_USERNAME }}/telegrammusicstatus:${{ github.ref_name }}
remove-old-artifacts:
needs: build-and-publish
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Remove old artifacts
uses: c-hive/gha-remove-artifacts@v1
with:
age: '1 day'
skip-recent: 1