Updated environment case #39
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: Docker Image CI | |
on: [push] | |
env: | |
DOCKER_TAG: latest | |
LINUX_DOCKER_IMAGE_NAME: ghcr.io/sslcom/codesigner:latest | |
WINDOWS_DOCKER_IMAGE_NAME: ghcr.io/sslcom/codesigner-win:latest | |
WINDOWS_2019_DOCKER_IMAGE_NAME: ghcr.io/sslcom/codesigner-win2019:latest | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Image Name | |
run: | | |
echo "DOCKER_TAG=${{ github.ref_name }}" >> $GITHUB_ENV | |
if: startsWith(github.ref, 'refs/tags/') | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm64,linux/arm/7 | |
driver-opts: 'image=moby/buildkit:v0.10.5' | |
- uses: mr-smithers-excellent/docker-build-push@v6 | |
name: Build & Push Docker image (Linux) | |
with: | |
image: codesigner | |
tags: ${{ env.DOCKER_TAG }} | |
registry: ghcr.io | |
multiPlatform: true | |
dockerfile: Dockerfile | |
platform: linux/amd64,linux/arm64,linux/arm/7 | |
overrideDriver: true | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
build-windows-2022: | |
runs-on: windows-2022 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Image Name | |
run: | | |
echo "DOCKER_TAG=${{ github.ref_name }}" >> $GITHUB_ENV | |
if: startsWith(github.ref, 'refs/tags/') | |
- uses: mr-smithers-excellent/docker-build-push@v6 | |
name: Build & Push Docker image (Windows) | |
with: | |
image: codesigner-win | |
tags: ${{ env.DOCKER_TAG }} | |
registry: ghcr.io | |
multiPlatform: false | |
dockerfile: Dockerfile-ltsc2022 | |
platform: windows/amd64 | |
overrideDriver: true | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
build-windows-2019: | |
runs-on: windows-2019 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Image Name | |
run: | | |
echo "DOCKER_TAG=${{ github.ref_name }}" >> $GITHUB_ENV | |
if: startsWith(github.ref, 'refs/tags/') | |
- uses: mr-smithers-excellent/docker-build-push@v6 | |
name: Build & Push Docker image (Windows) | |
with: | |
image: codesigner-win2019 | |
tags: ${{ env.DOCKER_TAG }} | |
registry: ghcr.io | |
multiPlatform: false | |
dockerfile: Dockerfile-ltsc2019 | |
platform: windows/amd64 | |
overrideDriver: true | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
test-linux: | |
runs-on: ubuntu-latest | |
needs: [build-linux] | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Image Name | |
run: | | |
echo "LINUX_DOCKER_IMAGE_NAME=ghcr.io/sslcom/codesigner:${{ github.ref_name }}" >> $GITHUB_ENV | |
if: startsWith(github.ref, 'refs/tags/') | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull Docker image to Github package registry | |
run: docker pull ${{ env.LINUX_DOCKER_IMAGE_NAME }} | |
- name: Create Artifacts Directory | |
shell: bash | |
run: | | |
mkdir ${GITHUB_WORKSPACE}/artifacts | |
- name: Sign Example PS1 File | |
run: docker run -i --rm --volume ${GITHUB_WORKSPACE}/artifacts:/codesign/output --env-file .env ${{ env.LINUX_DOCKER_IMAGE_NAME }} sign -input_file_path=/codesign/examples/codesign.ps1 -output_dir_path=/codesign/output | |
- name: Upload Signed Files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: codesign.ps1 | |
path: ./artifacts/codesign.ps1 | |
test-windows-2022: | |
runs-on: windows-2022 | |
needs: [build-windows-2022] | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Image Name | |
run: | | |
echo "WINDOWS_DOCKER_IMAGE_NAME=ghcr.io/sslcom/codesigner-win:${{ github.ref_name }}" >> $GITHUB_ENV | |
if: startsWith(github.ref, 'refs/tags/') | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull Docker image to Github package registry | |
run: docker pull ${{ env.WINDOWS_DOCKER_IMAGE_NAME }} | |
- name: Create Artifacts Directory | |
shell: powershell | |
run: | | |
New-Item -ItemType Directory -Force -Path .\artifacts | |
- name: Sign Example PS1 File | |
shell: powershell | |
run: | | |
docker run -i --rm --volume .\artifacts:C:\CodeSignTool\output --env-file .env ${{ env.WINDOWS_DOCKER_IMAGE_NAME }} sign ``-input_file_path=C:\CodeSignTool\examples\codesign.ps1 ``-output_dir_path=C:\CodeSignTool\output | |
- name: Upload Signed Files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: codesign-win.ps1 | |
path: ./artifacts/codesign.ps1 | |
test-windows-2019: | |
runs-on: windows-2019 | |
needs: [build-windows-2019] | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Image Name | |
run: | | |
echo "WINDOWS_2019_DOCKER_IMAGE_NAME=ghcr.io/sslcom/codesigner-win2019:${{ github.ref_name }}" >> $GITHUB_ENV | |
if: startsWith(github.ref, 'refs/tags/') | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull Docker image to Github package registry | |
run: docker pull ${{ env.WINDOWS_2019_DOCKER_IMAGE_NAME }} | |
- name: Create Artifacts Directory | |
shell: powershell | |
run: | | |
New-Item -ItemType Directory -Force -Path .\artifacts | |
- name: Sign Example PS1 File | |
shell: powershell | |
run: | | |
docker run -i --rm --volume .\artifacts:C:\CodeSignTool\output --env-file .env ${{ env.WINDOWS_2019_DOCKER_IMAGE_NAME }} sign ``-input_file_path=C:\CodeSignTool\examples\codesign.ps1 ``-output_dir_path=C:\CodeSignTool\output | |
- name: Upload Signed Files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: codesign-win.ps1 | |
path: ./artifacts/codesign.ps1 |