-
Notifications
You must be signed in to change notification settings - Fork 3
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
Kevin Mack
committed
Jun 10, 2024
1 parent
1198348
commit e802585
Showing
1 changed file
with
58 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: spacefx-dev-build-publish | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- km/add_tar_file | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
FEATURE: microsoft/azure-orbital-space-sdk/spacefx-dev | ||
ARTIFACT_PATH: ./output/spacefx-dev/devcontainer-feature-spacefx-dev.tgz | ||
|
||
jobs: | ||
build-tar-file: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/initialize@km/add_structure | ||
with: | ||
env_file: ./env/spacefx.env | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: microsoft/azure-orbital-space-sdk-github-actions/composite-actions/install-oras@km/add_structure | ||
with: | ||
oras_version: 0.12.0 | ||
|
||
- name: Build and package tar file | ||
shell: bash | ||
run: | | ||
source ./env/spacefx.env | ||
REGISTRY=ghcr.io/microsoft | ||
# No other changes needed below this line | ||
FEATURE=azure-orbital-space-sdk/spacefx-dev | ||
ARTIFACT_PATH=./output/spacefx-dev/devcontainer-feature-spacefx-dev.tgz | ||
# Validate the output directory exists and clean it out if there is content already present | ||
mkdir -p "./output/spacefx-dev" | ||
[[ -f ./output/spacefx-dev/* ]]; rm ./output/spacefx-dev/* | ||
# Copy the scripts ino the entry point for the devcontainer feature | ||
./.vscode/copy_to_spacedev.sh --output_dir ./.devcontainer/features/spacefx-dev/azure-orbital-space-sdk-setup | ||
# Build the devcontaienr feature | ||
devcontainer features package --force-clean-output-folder ./.devcontainer/features --output-folder ./output/spacefx-dev | ||
# Push the devcontainer feature tarball to the registry | ||
oras push ${{ env.REGISTRY }}/${{ env.FEATURE }}:${SPACEFX_VERSION} \ | ||
--config /dev/null:application/vnd.devcontainers \ | ||
--annotation org.opencontainers.image.source=https://github.com/microsoft/azure-orbital-space-sdk-setup \ | ||
${{ env.ARTIFACT_PATH }}:application/vnd.devcontainers.layer.v1+tar |