Compare commits

..

2 Commits

Author SHA1 Message Date
Maschell
ae56ec900c Use actions/checkout@v3 2023-03-16 11:31:26 +01:00
Maschell
09bf8e3f25 Change docker registry to ghcr.io 2023-03-16 11:31:26 +01:00
2 changed files with 37 additions and 30 deletions

View File

@ -4,34 +4,41 @@ on:
branches:
- master
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
clang-format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: clang-format
run: |
docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source ./include
build:
build-and-push-image:
runs-on: ubuntu-latest
needs: clang-format
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@master
- name: Get release version
id: get_release_tag
run: |
echo RELEASE_VERSION=$(echo $(date '+%Y%m%d')) >> $GITHUB_ENV
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: ${{ github.repository }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
snapshot: true
cache: true
tags: "latest, ${{ env.RELEASE_VERSION }}"
- name: Checkout repository
uses: actions/checkout@v3
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value={{date 'YYYYMMDD'}}-{{sha}}
type=raw,value={{date 'YYYYMMDD'}}
type=raw,value=latest
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.CI_PAT_WRITE_PACKAGE }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true

View File

@ -25,12 +25,12 @@ After that you can simply include `<kernel/kernel.h>` to get access to the kerne
A prebuilt version of this lib can found on dockerhub. To use it for your projects, add this to your Dockerfile.
```
[...]
COPY --from=wiiuenv/libkernel:[tag] /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libkernel:[tag] /artifacts $DEVKITPRO
[...]
```
Replace [tag] with a tag you want to use, a list of tags can be found [here](https://hub.docker.com/r/wiiuenv/libkernel/tags).
Replace [tag] with a tag you want to use, a list of tags can be found [here](https://github.com/wiiu-env/libkernel/pkgs/container/libkernel/versions).
It's highly recommended to pin the version to the **latest date** instead of using `latest`.
## Format the code via docker
`docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source ./include -i`
`docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source ./include -i`