-
Notifications
You must be signed in to change notification settings - Fork 1
/
github-workflows.linux-container.yml
67 lines (60 loc) · 2.18 KB
/
github-workflows.linux-container.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
name: ci-master-pr
on:
push:
branches:
- master
tags:
- '**'
pull_request:
branches:
- master
jobs:
test-job-1:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
test-job-2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
release:
needs:
- test-job-1
- test-job-2
runs-on: ubuntu-latest
container:
image: theohbrothers/docker-powershell:7.2-ubuntu-22.04-git
steps:
- uses: actions/checkout@v1
- name: Powershell version
run: |
pwsh -NoLogo -NonInteractive -NoProfile -Command '$PSVersionTable'
- name: Ignore git permissions
run: |
git config --global --add safe.directory "$( pwd )"
- name: Generate release notes
run: |
# Clone PSRepositoryReleaseManager
git clone https://github.com/theohbrothers/PSRepositoryReleaseManager.git --recurse-submodules --depth 1 --shallow-submodules --branch 'vx.x.x' # Specify tag ref to checkout to
# Process applicable environment variables
export RELEASE_TAG_REF=$( echo "$GITHUB_REF" | sed -rn 's/^refs\/tags\/(.*)/\1/p' )
# Generate (Generates release notes)
pwsh -NoLogo -NonInteractive -NoProfile -Command '$VerbosePreference = "Continue"; ./PSRepositoryReleaseManager/Invoke-Generate.ps1'
cat PSRepositoryReleaseManager/.release-notes.md
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-notes
include-hidden-files: true
path: PSRepositoryReleaseManager/.release-notes.md
- name: Create release
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Process applicable environment variables
export RELEASE_TAG_REF=$( echo "$GITHUB_REF" | sed -rn 's/^refs\/tags\/(.*)/\1/p' )
export RELEASE_NAMESPACE="$GITHUB_REPOSITORY_OWNER"
export RELEASE_REPOSITORY=$( basename "$( git rev-parse --show-toplevel )" )
# Release (Creates GitHub release)
pwsh -NoLogo -NonInteractive -NoProfile -Command '$VerbosePreference = "Continue"; ./PSRepositoryReleaseManager/Invoke-Release.ps1'