Update actions #228
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
- 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@v4 | |
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@v4 | |
- 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@v4 | |
- 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 |