-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e329a0
commit b5da656
Showing
7 changed files
with
182 additions
and
35 deletions.
There are no files selected for viewing
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
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
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,80 @@ | ||
name: Publish Zarf Package | ||
|
||
on: | ||
workflow_call: | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
|
||
jobs: | ||
build-and-publish-package: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.PAT }} | ||
repository: ${{ github.repository }} | ||
ref: ${{ github.ref_name }} | ||
|
||
- name: Login to Registry1 | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: registry1.dso.mil | ||
username: ${{ secrets.REGISTRY1_USERNAME }} | ||
password: ${{ secrets.REGISTRY1_PASSWORD }} | ||
|
||
- name: Init zarf cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: "~/.zarf-cache" | ||
key: zarf-cache | ||
|
||
- name: Free GH runner build space | ||
run: | | ||
df -h | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /usr/local/lib/android | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf /opt/hostedtoolcache/CodeQL | ||
sudo docker image prune --all --force | ||
df -h | ||
- name: Install zarf | ||
uses: supplypike/setup-bin@v3 | ||
with: | ||
# renovate: zarf-uri datasource=github-tags depName=defenseunicorns/zarf | ||
uri: 'https://github.com/defenseunicorns/zarf/releases/download/v0.31.2/zarf_v0.31.2_Linux_amd64' | ||
name: 'zarf' | ||
# renovate: datasource=github-tags depName=defenseunicorns/zarf versioning=semver | ||
version: 'v0.31.2' | ||
|
||
- name: Build mattermost package | ||
run: zarf package create --confirm --no-progress | ||
|
||
- name: Run E2E Tests | ||
uses: ./.github/actions/e2e | ||
with: | ||
token: ${{ secrets.PAT }} | ||
role-to-assume: ${{ secrets.AWS_COMMERCIAL_ROLE_TO_ASSUME }} | ||
region: ${{ vars.AWS_REGION }} | ||
github-context: "test / e2e (${{github.event_name}})" | ||
aws-availability-zone: ${{ vars.AWS_AVAILABILITY_ZONE }} | ||
registry1-username: ${{ secrets.REGISTRY1_USERNAME }} | ||
registry1-password: ${{ secrets.REGISTRY1_PASSWORD }} | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish mattermost package | ||
run: zarf package publish zarf-package-mattermost-amd64-*.tar.zst oci://ghcr.io/defenseunicorns/uds-capability --no-progress | ||
|
||
- name: Publish mattermost skeleton | ||
run: zarf package publish . oci://ghcr.io/defenseunicorns/uds-capability --no-progress |
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,56 @@ | ||
name: Tag, Test and Publish UDS Capability | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
|
||
jobs: | ||
tag-new-version: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_created: ${{ steps.release-flag.outputs.release_created }} | ||
steps: | ||
- name: Create Release Tag | ||
id: tag | ||
uses: google-github-actions/release-please-action@v3 | ||
with: | ||
command: manifest # use configs in release-please-config.json | ||
- id: release-flag | ||
run: echo "release_created=${{ steps.tag.outputs.release_created || false }}" >> $GITHUB_OUTPUT | ||
|
||
# Testing non release pushes to main | ||
test-uds-capability: | ||
runs-on: ubuntu-latest | ||
needs: tag-new-version | ||
if: ${{ needs.tag-new-version.outputs.release_created == 'false'}} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.PAT }} | ||
repository: ${{ github.repository }} | ||
ref: ${{ github.ref_name }} | ||
- name: Run E2E Tests | ||
uses: ./.github/actions/e2e | ||
with: | ||
token: ${{ secrets.PAT }} | ||
role-to-assume: ${{ secrets.AWS_COMMERCIAL_ROLE_TO_ASSUME }} | ||
region: ${{ vars.AWS_REGION }} | ||
github-context: "test / e2e (${{github.event_name}})" | ||
aws-availability-zone: ${{ vars.AWS_AVAILABILITY_ZONE }} | ||
registry1-username: ${{ secrets.REGISTRY1_USERNAME }} | ||
registry1-password: ${{ secrets.REGISTRY1_PASSWORD }} | ||
|
||
# Testing and publishing release pushes to main | ||
test-and-publish-uds-capability: | ||
needs: tag-new-version | ||
if: ${{ needs.tag-new-version.outputs.release_created == 'true'}} | ||
uses: ./.github/workflows/publish-package.yml | ||
secrets: inherit |
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
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,3 @@ | ||
{ | ||
".": "0.1.0" | ||
} |
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,18 @@ | ||
{ | ||
"packages": { | ||
".": { | ||
"release-type": "simple", | ||
"draft": false, | ||
"changelog-path": "CHANGELOG.md", | ||
"changelog-sections": [ | ||
{ "type": "feat", "section": "Features", "hidden": false }, | ||
{ "type": "fix", "section": "Bug Fixes", "hidden": false }, | ||
{ "type": "chore", "section": "Miscellaneous", "hidden": false } | ||
], | ||
"versioning": "always-bump-patch", | ||
"extra-files": [ | ||
"zarf.yaml" | ||
] | ||
} | ||
} | ||
} |