forked from rudof-project/rudof
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (147 loc) · 6.41 KB
/
artifacts.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Artifacts
on:
push:
branches:
- main
release:
types:
- published
permissions: write-all
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
runs-on: ubuntu-latest
steps:
- name: Allow the workflow to access the files of the repository
uses: actions/checkout@v3
with:
submodules: true
- name: Update Rustup
run: rustup update
- name: Use an intelligent Rust cache for building the project
uses: Swatinem/rust-cache@v2
- name: Build the release version of `rudof` for the x86 architecture
run: cargo build --release
- name: Upload the generated Artifact for it to be stored in its corresponding release (x86)
uses: actions/upload-artifact@v3
with:
name: ${{ vars.BINARY_NAME }}_x86_64_linux_gnu
path: target/release/${{ vars.BINARY_NAME }}
- name: Rename the binary according to the version and architecture
run: mv target/release/${{ vars.BINARY_NAME }} ${{ vars.BINARY_NAME }}_${{ github.event.release.tag_name }}_x86_64_linux_gnu
if: github.event_name == 'release'
- name: Upload the generated binaries to their corresponding release
uses: softprops/action-gh-release@v1
with:
files: |
${{ vars.BINARY_NAME }}_${{ github.event.release.tag_name }}_x86_64_linux_gnu
if: github.event_name == 'release'
mac:
runs-on: macos-latest
env:
DEVELOPER_DIR: '/Applications/Xcode.app/Contents/Developer'
SDKROOT: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'
MACOSX_DEPLOYMENT_TARGET: '10.14'
steps:
- name: Allow the workflow to access the files of the repository
uses: actions/checkout@v3
with:
submodules: true
- name: Use an intelligent Rust cache for building the project
uses: Swatinem/rust-cache@v2
- name: Build the release version of `rudof` for the x86 architecture
run: cargo build --release
- name: Build the release version of `rudof` for the aarch64 architecture
run: cargo build --release --target aarch64-apple-darwin
- name: Upload the generated Artifact for it to be stored in its corresponding release (x86)
uses: actions/upload-artifact@v3
with:
name: ${{ vars.BINARY_NAME }}_x86_64_apple
path: target/release/${{ vars.BINARY_NAME }}
- name: Upload the generated Artifact for it to be stored in its corresponding release (aarch64)
uses: actions/upload-artifact@v3
with:
name: ${{ vars.BINARY_NAME }}_aarch64_apple
path: target/aarch64-apple-darwin/release/${{ vars.BINARY_NAME }}
- name: Rename the binary according to the version and architecture
run: mv target/release/${{ vars.BINARY_NAME }} ${{ vars.BINARY_NAME }}_${{ github.event.release.tag_name }}_x86_64_apple
if: github.event_name == 'release'
- name: Rename the binary according to the version and architecture
run: mv target/aarch64-apple-darwin/release/${{ vars.BINARY_NAME }} ${{ vars.BINARY_NAME }}_${{ github.event.release.tag_name }}_aarch64_apple
if: github.event_name == 'release'
- name: Upload the generated binaries to their corresponding release
uses: softprops/action-gh-release@v1
with:
files: |
${{ vars.BINARY_NAME }}_${{ github.event.release.tag_name }}_x86_64_apple
${{ vars.BINARY_NAME }}_${{ github.event.release.tag_name }}_aarch64_apple
if: github.event_name == 'release'
windows:
runs-on: windows-latest
steps:
- name: Allow the workflow to access the files of the repository
uses: actions/checkout@v3
with:
submodules: true
- name: Update Rustup
run: rustup update
- name: Use an intelligent Rust cache for building the project
uses: Swatinem/rust-cache@v2
- name: Remove the MySys64 libraries and utilities
run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
- name: Build the release version of `rudof` for the x86 architecture
run: cargo build --release
- name: Upload the generated Artifact for it to be stored in its corresponding release (x86)
uses: actions/upload-artifact@v3
with:
name: ${{ vars.BINARY_NAME }}_x86_64_windows_msvc
path: target/release/${{ vars.BINARY_NAME }}.exe
- name: Rename the binary according to the version and architecture
run: mv target/release/${{ vars.BINARY_NAME }}.exe ${{ vars.BINARY_NAME }}_${{ github.event.release.tag_name }}_x86_64_windows_msvc.exe
if: github.event_name == 'release'
- name: Upload the generated binary to its corresponding release
uses: softprops/action-gh-release@v1
with:
files: ${{ vars.BINARY_NAME }}_${{ github.event.release.tag_name }}_x86_64_windows_msvc.exe
if: github.event_name == 'release'
deb:
runs-on: ubuntu-latest
steps:
- name: Allow the workflow to access the files of the repository
uses: actions/checkout@v3
- name: Install cargo deb
run: cargo install cargo-deb
- name: Build the .deb file using cargo deb
run: cargo deb
- name: Upload the .deb Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ vars.BINARY_NAME }}
path: target/debian/*.deb
- name: Rename the binary according to the version and architecture
run: mv target/debian/*.deb ${{ vars.BINARY_NAME }}_${{ github.event.release.tag_name }}_amd64.deb
- name: Upload the generated binary to its corresponding release
uses: softprops/action-gh-release@v1
with:
files: ${{ vars.BINARY_NAME }}_${{ github.event.release.tag_name }}_amd64.deb
if: github.event_name == 'release'
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@v6
with:
push: true
no-cache: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ vars.BINARY_NAME }}:latest