-
Notifications
You must be signed in to change notification settings - Fork 347
90 lines (85 loc) · 3.6 KB
/
nightlyrelease.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Nightly Release to PowerShell Gallery and Docker Hub
on:
workflow_dispatch:
schedule:
- cron: '30 2 * * *'
permissions: read-all
jobs:
build:
runs-on: windows-latest
steps:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.x
7.x
8.x
- uses: actions/checkout@v4
with:
ref: dev
token: ${{ secrets.PAT }}
- name: Build and Publish Module
env:
POWERSHELLGALLERY_API_KEY: ${{ secrets.POWERSHELLGALLERY_API_KEY }}
shell: pwsh
run: |
./build/Build-Nightly.ps1
- name: Set variables
shell: pwsh
run: |
$version = Get-Content version.txt -raw
"BUILDVERSION=$version" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
- name: Add & Commit
uses: EndBug/add-and-commit@v9
with:
message: 'Nightly publish to PowerShell Gallery'
tag: '${{env.BUILDVERSION}}-nightly --force'
push: true
publish-docker-windows-2022:
runs-on: windows-2022
needs: [ build ]
steps:
- uses: actions/checkout@v4
- name: Build an image
run: |
$VERSION="$(cat ./version.txt)-nightly"
docker build --build-arg "PNP_MODULE_VERSION=$VERSION" --build-arg "BASE_IMAGE_SUFFIX=lts-nanoserver-ltsc2022" --build-arg "INSTALL_USER=ContainerAdministrator" --build-arg "SKIP_PUBLISHER_CHECK=True" ./docker -f ./docker/pnppowershell.dockerFile --tag "${{ secrets.DOCKER_ORG }}/powershell:$VERSION-lts-nanoserver-ltsc2022";
- name: Push the image
run: |
$VERSION="$(cat ./version.txt)-nightly"
docker login -u ${{ secrets.DOCKER_USERNAME }} -p '${{ secrets.DOCKER_PASSWORD }}'
docker push "${{ secrets.DOCKER_ORG }}/powershell:$VERSION-lts-nanoserver-ltsc2022"
publish-docker-windows-2019:
runs-on: windows-2019
needs: [ build ]
steps:
- uses: actions/checkout@v4
- name: Build an image
run: |
$VERSION="$(cat ./version.txt)-nightly"
docker build --build-arg "PNP_MODULE_VERSION=$VERSION" --build-arg "BASE_IMAGE_SUFFIX=lts-nanoserver-1809" --build-arg "INSTALL_USER=ContainerAdministrator" --build-arg "SKIP_PUBLISHER_CHECK=True" ./docker -f ./docker/pnppowershell.dockerFile --tag "${{ secrets.DOCKER_ORG }}/powershell:$VERSION-lts-nanoserver-1809";
- name: Push the image
run: |
$VERSION="$(cat ./version.txt)-nightly"
docker login -u ${{ secrets.DOCKER_USERNAME }} -p '${{ secrets.DOCKER_PASSWORD }}'
docker push "${{ secrets.DOCKER_ORG }}/powershell:$VERSION-lts-nanoserver-1809"
publish-docker-linux:
runs-on: ubuntu-latest
needs: [ build ]
steps:
- uses: actions/checkout@v4
- name: Build an image
run: |
VERSION=$(cat ./version.txt)-nightly
docker build --build-arg "PNP_MODULE_VERSION=$VERSION" --build-arg "BASE_IMAGE_SUFFIX=lts-alpine-3.17" --build-arg "INSTALL_USER=root" --build-arg "SKIP_PUBLISHER_CHECK=False" ./docker -f ./docker/pnppowershell.dockerFile --tag ${{ secrets.DOCKER_ORG }}/powershell:$VERSION-lts-alpine-3.17;
- name: Tag the image
run: |
VERSION=$(cat ./version.txt)-nightly
docker image tag ${{ secrets.DOCKER_ORG }}/powershell:$VERSION-lts-alpine-3.17 ${{ secrets.DOCKER_ORG }}/powershell:nightly
- name: Push the image
run: |
VERSION=$(cat ./version.txt)-nightly
docker login -u ${{ secrets.DOCKER_USERNAME }} -p '${{ secrets.DOCKER_PASSWORD }}'
docker push ${{ secrets.DOCKER_ORG }}/powershell:$VERSION-lts-alpine-3.17
docker push ${{ secrets.DOCKER_ORG }}/powershell:nightly