-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from theohbrothers/docs/samples-add-samples-fo…
…r-using-project-with-github-workflows Docs (samples): Add samples for using project with GitHub Workflows
- Loading branch information
Showing
2 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
docs/samples/ci/github/generic/github-workflows.linux.container.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 project | ||
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 PROJECT_DIRECTORY=$( git rev-parse --show-toplevel ) | ||
export RELEASE_TAG_REF=$( echo "$GITHUB_REF" | sed -rn 's/^refs\/tags\/(.*)/\1/p' ) | ||
# Generate (Generates release notes) | ||
pwsh -c '$VerbosePreference = "Continue"; ./PSRepositoryReleaseManager/src/scripts/ci/Invoke-Generate.ps1' | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-notes | ||
path: PSRepositoryReleaseManager/.release-notes.md | ||
- name: Create release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
# Process applicable environment variables | ||
export PROJECT_DIRECTORY=$( git rev-parse --show-toplevel ) | ||
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 -c '$VerbosePreference = "Continue"; ./PSRepositoryReleaseManager/src/scripts/ci/Invoke-Release.ps1' | ||
env: | ||
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
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 | ||
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 project | ||
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 PROJECT_DIRECTORY=$( git rev-parse --show-toplevel ) | ||
export RELEASE_TAG_REF=$( echo "$GITHUB_REF" | sed -rn 's/^refs\/tags\/(.*)/\1/p' ) | ||
# Generate (Generates release notes) | ||
pwsh -c '$VerbosePreference = "Continue"; ./PSRepositoryReleaseManager/src/scripts/ci/Invoke-Generate.ps1' | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-notes | ||
path: PSRepositoryReleaseManager/.release-notes.md | ||
- name: Create release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
# Process applicable environment variables | ||
export PROJECT_DIRECTORY=$( git rev-parse --show-toplevel ) | ||
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 -c '$VerbosePreference = "Continue"; ./PSRepositoryReleaseManager/src/scripts/ci/Invoke-Release.ps1' | ||
env: | ||
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |