forked from lucasamorimca/codeql-solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (95 loc) · 2.91 KB
/
Copy pathrelease.yml
File metadata and controls
115 lines (95 loc) · 2.91 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
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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
packages: write
env:
CARGO_TERM_COLOR: always
jobs:
create-binaries:
name: Create ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: linux-x64
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
name: linux-arm64
use_cross: true
- target: x86_64-apple-darwin
os: macos-15
name: macos-x64
- target: aarch64-apple-darwin
os: macos-latest
name: macos-arm64
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.use_cross
run: cargo install cross
- name: Compile (native)
if: ${{ !matrix.use_cross }}
run: cargo build --release --target ${{ matrix.target }}
working-directory: extractor
- name: Compile (cross)
if: matrix.use_cross
run: cross build --release --target ${{ matrix.target }}
working-directory: extractor
- name: Package
run: |
mkdir -p output
cp target/${{ matrix.target }}/release/codeql-extractor-solidity output/
tar -czvf codeql-extractor-solidity-${{ matrix.name }}.tar.gz -C output .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: codeql-extractor-solidity-${{ matrix.name }}.tar.gz
release:
name: Create Release
needs: create-binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download artifacts
uses: actions/download-artifact@v7
with:
path: artifacts
- name: Create checksums
run: |
cd artifacts
sha256sum */*.tar.gz > checksums.txt
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/**/*.tar.gz
artifacts/checksums.txt
generate_release_notes: true
publish-packs:
name: Publish CodeQL Packs
needs: create-binaries
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
- name: Install CodeQL
run: gh extensions install github/gh-codeql
- name: Publish library pack
run: gh codeql pack publish ql/lib || echo "Pack already published, continuing..."
- name: Install query pack dependencies
run: gh codeql pack install queries
- name: Publish query pack
run: gh codeql pack publish queries || echo "Pack already published, continuing..."