-
-
Notifications
You must be signed in to change notification settings - Fork 88
63 lines (61 loc) · 2.02 KB
/
dist.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
name: Distribution
on:
push:
branches:
jobs:
tarball:
name: Create source tarball
if: startsWith(github.ref, 'refs/tags/deploy-test-') || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: |
git submodule init
git submodule update
- name: Create tarball
shell: bash
run: |
find . -name ".git*" | xargs rm -rfv
shopt -s extglob
mkdir rz-ghidra
mv !(rz-ghidra) rz-ghidra
tar -czvf rz-ghidra-src.tar.gz rz-ghidra
- uses: actions/upload-artifact@v2
with:
name: rz-ghidra-src.tar.gz
path: rz-ghidra-src.tar.gz
create-release:
name: Create draft release and upload artifacts
runs-on: ubuntu-latest
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/deploy-test-') || startsWith(github.ref, 'refs/tags/v'))
needs: [
tarball
]
steps:
- uses: actions/checkout@v3
- name: Extract version
id: extract_version
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.extract_version.outputs.version }}
draft: true
prerelease: false
- uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R
- name: Upload rz-ghidra src tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./rz-ghidra-src.tar.gz/rz-ghidra-src.tar.gz
asset_name: rz-ghidra-src-${{ steps.extract_version.outputs.version }}.tar.gz
asset_content_type: application/zip