Skip to content

Commit

Permalink
Add github action configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMore201 committed Jul 23, 2024
1 parent 671c74a commit b6d76c0
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build

on:
push:
branches:
- 'main'
- 'feature/**'
pull_request:
workflow_dispatch:

jobs:
build:
name: Toolchain build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: sudo ./install-deps

- name: Build
run: ./build-toolchain

- name: Package
run: |
cd ./INSTALL
zip -r9 ../linux.zip .
cd ../INSTALL-WIN
zip -r9X ../win32.zip .
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: tricore-gcc-artifacts
path: ./*.zip
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
release:
types: [published]
workflow_dispatch:

jobs:
build:
name: Publish Release artifacts
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Extract commit SHA
shell: bash
run: |
echo "SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
- name: Download artifacts from latest workflow
uses: dawidd6/action-download-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build.yml
branch: ${{ github.event.release.target_commitish }}
workflow_conclusion: success
skip_unpack: false

- name: Renabe build artifacts
run: |
mv linux.zip tricore-gcc-11.3.1-${{ env.SHORT_SHA }}-linux.zip
mv win32.zip tricore-gcc-11.3.1-${{ env.SHORT_SHA }}-win32.zip
- name: Push release artifacts
uses: softprops/action-gh-release@v2
with:
files: |
*.zip
13 changes: 13 additions & 0 deletions install-deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

set -e

if [ ! -f /etc/lsb_release ] && [ ! -f /etc/debian_version ]
then
echo "Script is meant to install packages on Debian/Ubuntu based distributions"
echo "Pleas install dependencies manually on other distributions"
exit 1
fi

apt-get update
apt-get -y install build-essential build-essential gcc-mingw-w64 g++-mingw-w64 texinfo flex bison libmpfr-dev libgmp-dev libmpc-dev zip

0 comments on commit b6d76c0

Please sign in to comment.