30
30
fail-fast : false
31
31
matrix :
32
32
include :
33
- - { target: aarch64-unknown-linux-gnu, os: ubuntu-latest, image: 'ubuntu:20.04' }
34
33
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, image: 'ubuntu:20.04' }
35
34
- { target: aarch64-apple-darwin, os: macos-latest }
36
- - { target: x86_64-apple-darwin, os: macos-13 }
37
- - { target: x86_64-pc-windows-msvc, os: windows-latest }
38
35
name : Build binaries for ${{ matrix.target }}
39
36
runs-on : ${{ matrix.os }}
40
37
container :
@@ -71,23 +68,17 @@ jobs:
71
68
- name : Build Rust binaries
72
69
run : |
73
70
cargo build --locked --release --target ${{ matrix.target }} --bin datadog-static-analyzer
74
- cargo build --locked --release --target ${{ matrix.target }} --bin datadog-static-analyzer-git-hook
75
- cargo build --locked --release --target ${{ matrix.target }} --bin datadog-static-analyzer-server
76
71
77
72
- name : Zip Rust binaries (Unix)
78
73
if : ${{ !startsWith(matrix.os, 'windows') }}
79
74
run : |
80
75
zip -j datadog-static-analyzer-${{ matrix.target }}.zip target/${{ matrix.target }}/release/datadog-static-analyzer
81
- zip -j datadog-static-analyzer-git-hook-${{ matrix.target }}.zip target/${{ matrix.target }}/release/datadog-static-analyzer-git-hook
82
- zip -j datadog-static-analyzer-server-${{ matrix.target }}.zip target/${{ matrix.target }}/release/datadog-static-analyzer-server
83
76
84
77
- name : Zip Rust binaries (Windows)
85
78
if : startsWith(matrix.os, 'windows')
86
79
run : |
87
80
cd target\${{ matrix.target }}\release
88
81
7z a datadog-static-analyzer-${{ matrix.target }}.zip datadog-static-analyzer.exe
89
- 7z a datadog-static-analyzer-git-hook-${{ matrix.target }}.zip datadog-static-analyzer-git-hook.exe
90
- 7z a datadog-static-analyzer-server-${{ matrix.target }}.zip datadog-static-analyzer-server.exe
91
82
move *.zip ..\..\..\
92
83
93
84
- name : Upload assets
96
87
name : ${{ matrix.target }}
97
88
path : |
98
89
datadog-static-analyzer-${{ matrix.target }}.zip
99
- datadog-static-analyzer-git-hook-${{ matrix.target }}.zip
100
- datadog-static-analyzer-server-${{ matrix.target }}.zip
101
90
if-no-files-found : error
102
91
retention-days : 7
103
92
@@ -124,15 +113,7 @@ jobs:
124
113
- name : Set release variable
125
114
id : set-release
126
115
run : |
127
- mainCount=$(git branch -r --contains ${{ github.ref }} --format "%(refname:lstrip=3)" | grep -xc main)
128
- if [[ $mainCount -eq 0 ]]; then
129
- echo "Tag was not pushed onto main branch, exiting"
130
- exit 1
131
- elif [[ $GITHUB_REF =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
132
- echo "release=true" >> $GITHUB_OUTPUT
133
- else
134
- echo "release=false" >> $GITHUB_OUTPUT
135
- fi
116
+ echo "release=false" >> $GITHUB_OUTPUT
136
117
137
118
- name : Download build artifacts
138
119
uses : actions/download-artifact@v4
@@ -143,16 +124,6 @@ jobs:
143
124
run : ls -lR
144
125
working-directory : artifacts
145
126
146
- - name : Create release
147
- if : ${{ steps.set-release.outputs.release == 'true' }}
148
- run : |-
149
- gh release create --generate-notes \
150
- ${{ github.ref_name }} \
151
- versions.json \
152
- artifacts/*/datadog-static-analyzer*.zip
153
- env :
154
- GH_TOKEN : ${{ github.token }}
155
-
156
127
- name : Create pre-release
157
128
if : ${{ steps.set-release.outputs.release == 'false' }}
158
129
run : |-
@@ -162,13 +133,3 @@ jobs:
162
133
artifacts/*/datadog-static-analyzer*.zip
163
134
env :
164
135
GH_TOKEN : ${{ github.token }}
165
-
166
- ghcr :
167
- needs : release
168
- uses : ' ./.github/workflows/ghcr.yml'
169
- with :
170
- release : ${{ needs.release.outputs.release == 'true' }}
171
- permissions :
172
- contents : read
173
- packages : write
174
- id-token : write
0 commit comments