-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (62 loc) · 2.05 KB
/
release_bot.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
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
name: Build & Create release
on:
push:
tags:
- "*"
env:
CARGO_TERM_COLOR: always
APPLICATION_FILE_NAME: media_fetch_bot
ARCHIVE_PREFIX: bot
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: cargo build --verbose --release
- name: Print Current Directory
run: pwd
- name: Print Current Directory www
run: ls -la
- name: Archive files on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
"tar -czvf $ARCHIVE_PREFIX-v${{ github.ref_name }}-ubuntu.tar.gz target/release/$APPLICATION_FILE_NAME"
- name: Archive files on macOS
if: matrix.os == 'macos-latest'
run: |
"tar -czvf $ARCHIVE_PREFIX-v${{ github.ref_name }}-macos.tar.gz target/release/$APPLICATION_FILE_NAME"
- name: Archive files on Windows
if: matrix.os == 'windows-latest'
run: |
"tar.exe acvf $ARCHIVE_PREFIX-v${{ github.ref_name }}-windows.zip target/release/$APPLICATION_FILE_NAME.exe"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Release-${{ matrix.os }}-v${{ github.ref_name }}
path: |
"$ARCHIVE_PREFIX-v${{ github.ref_name }}*"
retention-days: 1
create-release:
runs-on: ubuntu-latest
needs: [ build ]
steps:
- name: Download artifacts to release
uses: actions/download-artifact@v4
with:
path: .
- name: Create release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ github.ref_name }}
title: ${{ github.ref_name }}
prerelease: false
files: |
Release-windows-latest-v${{ github.ref_name }}
Release-ubuntu-latest-v${{ github.ref_name }}
Release-macos-latest-v${{ github.ref_name }}