Added release job for GDB

This commit is contained in:
takeshix 2021-04-19 16:03:23 +02:00
parent 3e9cf83e71
commit 4dd18e112a
2 changed files with 45 additions and 1 deletions

View file

@ -7,6 +7,8 @@ jobs:
name: Build GDB & gdbserver x86 name: Build GDB & gdbserver x86
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: muslcc/x86_64:i686-linux-musl container: muslcc/x86_64:i686-linux-musl
outputs:
version: ${{ steps.build_gdb.outputs.PACKAGED_VERSION }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -120,3 +122,43 @@ jobs:
with: with:
name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }} name: ${{ steps.build_gdb.outputs.PACKAGED_NAME }}
path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }} path: ${{ steps.build_gdb.outputs.PACKAGED_NAME_PATH }}
create-release:
name: Create GDB & gdbserver Release
runs-on: ubuntu-latest
needs: [build-x86, build-x86_64, build-armhf, build-aarch64]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare Environment
run: mkdir /tmp/releases
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: /tmp/releases
- name: List Artifacts
run: ls -laR /tmp/releases
- name: Tag Release
id: tag_release
run: |
set +e
if [ $(git tag "gdb-v${{ needs.build-x86.outputs.version }}") ];then
git push origin "gdb-v${{ needs.build-x86.outputs.version }}"
echo ::set-output name=NEW_RELEASE::"true"
else
echo "Tag for version ${{ needs.build-x86.outputs.version }} already exists. Skipping release creation."
echo ::set-output name=NEW_RELEASE::"false"
fi
- name: Create Release
uses: ncipollo/release-action@v1
if: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }}
with:
name: gdb-v${{ needs.build-x86.outputs.version }}
tag: gdb-v${{ needs.build-x86.outputs.version }}
artifacts: "/tmp/releases/*/*"
token: ${{ secrets.GITHUB_TOKEN }}

View file

@ -47,12 +47,14 @@ main() {
fi fi
GDB_VERSION=$(get_version "${BUILD_DIRECTORY}/gdb_build/gdb/gdb --version |head -n1 |awk '{print \$4}'") GDB_VERSION=$(get_version "${BUILD_DIRECTORY}/gdb_build/gdb/gdb --version |head -n1 |awk '{print \$4}'")
GDBSERVER_VERSION=$(get_version "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver --version |head -n1 |awk '{print \$4}'") GDBSERVER_VERSION=$(get_version "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver --version |head -n1 |awk '{print \$4}'")
version_number=$(echo "$GDB_VERSION" | cut -d"-" -f2)
cp "${BUILD_DIRECTORY}/gdb_build/gdb/gdb" "${OUTPUT_DIRECTORY}/gdb${GDB_VERSION}" cp "${BUILD_DIRECTORY}/gdb_build/gdb/gdb" "${OUTPUT_DIRECTORY}/gdb${GDB_VERSION}"
cp "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver" "${OUTPUT_DIRECTORY}/gdbserver${GDBSERVER_VERSION}" cp "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver" "${OUTPUT_DIRECTORY}/gdbserver${GDBSERVER_VERSION}"
echo "[+] Finished building GDB ${CURRENT_ARCH}" echo "[+] Finished building GDB ${CURRENT_ARCH}"
echo ::set-output name=PACKAGED_NAME::"gdb${GDB_VERSION}" echo ::set-output name=PACKAGED_NAME::"gdb${GDB_VERSION}"
echo ::set-output name=PACKAGED_NAME_PATH::"/output/*" echo ::set-output name=PACKAGED_NAME_PATH::"/output/*"
echo ::set-output name=PACKAGED_VERSION::"${version_number}"
} }
main main