run_build #357
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: CI | |
on: | |
push: | |
branches: | |
- "*" | |
tags: | |
- v* | |
pull_request: | |
repository_dispatch: | |
types: [run_build] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: ghcr.io/ps2dev/ps2-packer:latest | |
strategy: | |
matrix: | |
version: [[default, 0], [highloading, 1]] | |
steps: | |
- name: Install dependencies | |
run: | | |
apk add build-base git | |
- uses: actions/checkout@v3 | |
- name: Compile project | |
run: | | |
make clean all LOADHIGH=${{ matrix.version[1] }} | |
- name: Get short SHA | |
id: slug | |
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" | |
- name: Extract tag name | |
if: startsWith(github.ref, 'refs/tags/') | |
id: tag | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
- name: Compress & Rename bin folder | |
run: | | |
mv bin/ ps2link/ | |
mv contrib/icon.sys ps2link/icon.sys | |
mv contrib/PS2LINK.icn ps2link/PS2LINK.icn | |
tar -zcvf ps2link-${{ steps.slug.outputs.sha8 }}-${{ matrix.version[0] }}.tar.gz ps2link | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ps2link-${{ steps.slug.outputs.sha8 }}-${{ matrix.version[0] }} | |
path: ps2link-${{ steps.slug.outputs.sha8 }}-${{ matrix.version[0] }}.tar.gz | |
release: | |
needs: [build] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: ps2link | |
- name: Create pre-release | |
if: github.ref == 'refs/heads/master' | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: true | |
automatic_release_tag: latest | |
title: Development build | |
files: ps2link/**/*.tar.gz | |
- name: Create Tagged Release Draft | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: false | |
draft: true | |
automatic_release_tag: RenameMe | |
files: ps2link/**/*.tar.gz |