This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (97 loc) · 4.09 KB
/
release_created.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Release Created
on:
release:
types:
- created
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: runbooksolutions/agent:latest, runbooksolutions/agent:${{ github.event.release.tag_name }}
pyinstaller-build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
output: RBSAgent-windows
- os: ubuntu-latest
output: RBSAgent-linux
- os: macos-latest
output: RBSAgent-mac
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build and Publish Executable
uses: sayyid5416/pyinstaller@v1
with:
python_ver: '3.9' # Adjust the Python version as needed
spec: 'app.py' # Adjust the path to your .spec or .py file
requirements: 'requirements.txt' # Adjust the path to your requirements.txt file
upload_exe_with_name: ${{matrix.output}} # Adjust the desired artifact name
options: --onefile, --name "RBSAgent", --windowed
upload-release-assets:
permissions: write-all
runs-on: ubuntu-latest
needs: [pyinstaller-build]
steps:
- uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -alR
- name: Zip MacOS Build
run: cd RBSAgent-mac && zip -r9 RBSAgent RBSAgent.app
- name: Move linux files
run: |
mv RBSAgent-linux/RBSAgent RBSAgent
mv RBSAgent-mac/RBSAgent.zip RBSAgent.app.zip
mv RBSAgent-windows/RBSAgent.exe RBSAgent.exe
rm -rf RBSAgent-*
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./RBSAgent*
overwrite: true
# - name: Upload Release Asset Windows
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ github.event.release.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ./RBSAgent.exe/RBSAgent.exe
# asset_name: RBSAgent.exe
# asset_content_type: application/vnd.microsoft.portable-executable
# - name: Upload Release Asset Linux
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ github.event.release.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ./RBSAgent/RBSAgent
# asset_name: RBSAgent
# asset_content_type: application/x-executable
# - name: Upload Release Asset Mac
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ github.event.release.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ./RBSAgent.app.zip
# asset_name: RBSAgent
# asset_content_type: application/zip