Skip to content

CI

CI #34

Workflow file for this run

name:
CI
on:
workflow_dispatch:
push:
pull_request:
schedule:
- cron: '0 0 * * MON'
jobs:
test:
name: 'Testing'
runs-on: ubuntu-latest
strategy:
matrix:
docker_image: ['ubuntu-22.04-mtb:latest']
mtb_version: ['3.0.0.9369', '3.1.0.12257']
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Set Environment Variables'
run: |
echo 'docker_image_sanitized='`echo ${{ matrix.docker_image }} | sed 's/:/-/'` >> $GITHUB_ENV
- name: 'Test README.md Instructions'
env:
PROJECT_NAME: ${{ github.event.repository.name }}
DOCKER_IMAGE: ${{ matrix.docker_image }}
DOCKER_IMAGE_SANITIZED: ${{ env.docker_image_sanitized }}
DOCKER_REGISTRY: 'ghcr.io/wxleong/'
MTB_VERSION: ${{ matrix.mtb_version }}
run: |
.github/docker/launcher.sh
shell: bash
- name: 'Upload Artifacts'
uses: actions/upload-artifact@v3
with:
name: 'executed-test-scripts'
path: |
~/${{ github.event.repository.name }}_${{ env.docker_image_sanitized }}_${{ matrix.mtb_version }}/${{ github.event.repository.name }}_${{ env.docker_image_sanitized }}_${{ matrix.mtb_version }}.sh
release:
name: 'Create Release'
needs: test
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Changelog Pruning'
run: |
sed -n `awk '/## \[${{ github.ref_name }}/{c++} c==1{ print NR; exit }' CHANGELOG.md`',$p' CHANGELOG.md > .CHANGELOG.md.tmp
sed `awk '/## \[[x0-9]/{c++} c==2{ print NR; exit }' .CHANGELOG.md.tmp`',$d' .CHANGELOG.md.tmp > ${{ github.workspace }}-CHANGELOG.txt
- name: 'Create Release'
uses: softprops/action-gh-release@v1
with:
body_path: ${{ github.workspace }}-CHANGELOG.txt
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: false
files: |
LICENSE