WiiUModuleSystem/.github/workflows/push_image.yml

59 lines
2.0 KiB
YAML
Raw Normal View History

name: Publish Docker Image
on:
push:
branches:
- master
jobs:
2022-02-04 22:24:22 +01:00
clang-format-lib:
2022-09-04 17:25:55 +02:00
runs-on: ubuntu-22.04
2022-02-04 22:24:22 +01:00
steps:
2023-01-06 15:07:46 +01:00
- uses: actions/checkout@v3
2022-02-04 22:24:22 +01:00
- name: clang-format
run: |
docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./include ./libraries
build-lib:
2022-09-04 17:25:55 +02:00
runs-on: ubuntu-22.04
2022-02-04 22:24:22 +01:00
needs: clang-format-lib
steps:
2023-01-06 15:07:46 +01:00
- uses: actions/checkout@v3
2022-02-04 22:24:22 +01:00
- name: build binary
run: |
docker build . -f Dockerfile.buildlocal -t builder
docker run --rm -v ${PWD}:/project builder make
clang-format-examples:
2022-09-04 17:25:55 +02:00
runs-on: ubuntu-22.04
steps:
2023-01-06 15:07:46 +01:00
- uses: actions/checkout@v3
- name: clang-format
run: |
docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./example/example_module/source
build-examples:
2022-09-04 17:25:55 +02:00
runs-on: ubuntu-22.04
needs: clang-format-examples
steps:
2023-01-06 15:07:46 +01:00
- uses: actions/checkout@v3
- name: build binary
run: |
docker build . -f Dockerfile.buildexamples -t builder
cd ./example/example_module
docker run --rm -v ${PWD}:/project builder make
2022-02-04 22:24:22 +01:00
push_image:
runs-on: ubuntu-latest
needs: [build-lib, build-examples]
steps:
- uses: actions/checkout@master
- name: Get release version
id: get_release_tag
run: |
2021-01-01 20:18:43 +01:00
echo RELEASE_VERSION=$(echo $(date '+%Y%m%d')) >> $GITHUB_ENV
echo REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//" | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}' | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: ${{ env.REPOSITORY_OWNER }}/${{ env.REPOSITORY_NAME }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
snapshot: true
cache: true
tags: "latest, ${{ env.RELEASE_VERSION }}"