forked from TorgoTorgo/ghidra-container
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (96 loc) · 3.06 KB
/
main.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
name: "Container Build"
on:
push:
branches:
- main
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
platforms: "linux/amd64"
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-push:
name: Build and Push
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- ghidra-version: "latest"
jdk-version: "openjdk17"
- ghidra-version: "10.2.2"
jdk-version: "openjdk17"
- ghidra-version: "10.1.5"
jdk-version: "openjdk11"
- ghidra-version: "10.0.4"
jdk-version: "openjdk11"
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Get short SHA ref
id: vars
run: |
echo "sha_short=${GITHUB_SHA::8}" >> $GITHUB_ENV
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v2
if: ${{ contains(env.PLATFORMS, 'arm') }}
with:
platforms: "arm,arm64"
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
platforms: ${{ env.platforms }}
- name: Login to GHCR
id: login
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavour: |
suffix=-${{ matrix.ghidra-version }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=raw,value=${{ env.sha_short }}-${{ matrix.ghidra-version }},suffix=
type=raw,value=${{ matrix.ghidra-version }},suffix=
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.ghidra-version }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GHIDRA_VERSION=${{ matrix.ghidra-version }}
- name: Build and Push Versioned Tags
uses: docker/build-push-action@v3
with:
context: .
platforms: ${{ env.platforms }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=build-${{ env.IMAGE_NAME }}-${{ matrix.ghidra-version }}
cache-to: type=gha,mode=max,scope=build-${{ env.IMAGE_NAME }}-${{ matrix.ghidra-version }}
build-args: |
GHIDRA_VERSION=${{ matrix.ghidra-version }}
JDK_VERSION=${{ matrix.jdk-version }}