Skip to content

Commit

Permalink
Merge pull request #14 from illusion0001/patch-1
Browse files Browse the repository at this point in the history
CI: simplify steps
  • Loading branch information
clienthax authored Mar 16, 2022
2 parents 564c356 + 4ac0b7b commit 84f56cb
Showing 1 changed file with 47 additions and 29 deletions.
76 changes: 47 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,56 @@
name: CI

on:
push:
branches: master
pull_request:
branches: master
release:
types: created
workflow_dispatch:
on: [push, pull_request, workflow_dispatch]

jobs:
build:
name: Build Ghidra extension
build_extension:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ghidra-version:
- '10.0.4'
- '10.0.2'
- '10.0'
runs-on: ubuntu-latest
container: registry.gitlab.com/torgo/ghidra-container/ghidra-plugin-builder:${{ matrix.ghidra-version }}
ghidra: ['10.0.4', '10.1.1', '10.1.2']

steps:
- name: Clone
uses: actions/checkout@v2
- name: Compile - ${{ matrix.ghidra-version }}
run: |
gradle
ls -lah dist/
- uses: svenstaro/upload-release-action@v1-release
- name: Checkout
uses: actions/checkout@v3

- name: Get short SHA
run: echo "SHORT_SHA=${GITHUB_SHA:0:7}" >> $GITHUB_ENV

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin

- name: Setup Ghidra
uses: er28-0652/setup-ghidra@master
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
version: ${{ matrix.ghidra }}

- name: Build Extension
run: gradle

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
path: dist/
retention-days: 7

push_release:
if: |
github.event_name == 'push' &&
github.repository == 'clienthax/Ps3GhidraScripts'
needs: build_extension
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v3

- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create 1.0${{ GITHUB.RUN_NUMBER }} artifact/*.zip --target ${{ GITHUB.SHA }} -t 1.0${{ GITHUB.RUN_NUMBER }}

0 comments on commit 84f56cb

Please sign in to comment.