-
Notifications
You must be signed in to change notification settings - Fork 3
132 lines (118 loc) · 4.16 KB
/
ci.yml
File metadata and controls
132 lines (118 loc) · 4.16 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Release
on:
push:
tags:
- '*'
jobs:
release:
name: Release
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Node
id: node
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install
id: install
run: npm install
- name: Release
id: release
uses: justincy/github-action-npm-release@2.0.1
- name: Set up .npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMJS }}" > ~/.npmrc
- name: Publish to npmjs
if: ${{ steps.release.outputs.released == 'true' }}
run: npm publish --access public
- name: Upload JS
id: uploadjs
uses: actions/upload-release-asset@v1
if: ${{ steps.release.outputs.released == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/frida-cshell.js
asset_name: frida-cshell-${{ github.ref_name }}.js
asset_content_type: text/javascript
- name: Upload SH
id: uploadsh
uses: actions/upload-release-asset@v1
if: ${{ steps.release.outputs.released == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/frida-cshell
asset_name: frida-cshell-${{ github.ref_name }}
asset_content_type: text/x-shellscript
docker:
name: Docker
runs-on: ubuntu-24.04
permissions:
packages: write
contents: read
outputs:
image: ${{ steps.set-image.outputs.image }}
steps:
- name: Get Repo Name
run: echo "REPO_LOWER=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Set Image Output
id: set-image
run: echo "image=ghcr.io/${REPO_LOWER}:latest" >> $GITHUB_OUTPUT
- name: Checkout repo
uses: actions/checkout@v3
- name: Extract tag
id: tag
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Restore Docker build cache
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
# We want to be able to update the cache if the Dockerfile is changed,
# but still be able to use previous versions if available.
key: ${{ runner.os }}-buildx-${{ github.ref }}-${{ hashFiles('Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-${{ github.ref }}-
${{ runner.os }}-buildx-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ env.REPO_LOWER }}:latest
ghcr.io/${{ env.REPO_LOWER }}:${{ env.VERSION }}
cache-from: |
type=registry,ref=ghcr.io/${{ env.REPO_LOWER }}:cache
type=local,src=/tmp/.buildx-cache
cache-to: |
${{ github.ref == 'refs/heads/main' && 'type=registry,ref=ghcr.io/${{ env.REPO_LOWER }}:cache,mode=max' || 'type=local,dest=/tmp/.buildx-cache' }}
- name: Save Docker build cache
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
# We want to be able to update the cache if the Dockerfile is changed,
# but still be able to use previous versions if available.
key: ${{ runner.os }}-buildx-${{ github.ref }}-${{ hashFiles('Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-${{ github.ref }}-
${{ runner.os }}-buildx-