forked from Azure/azure-service-operator
-
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.
feat: Provide experimental images built from main (Azure#3699)
* Rename official release * First rough version * Update create-release-main.yml * Update create-release-main.yml * docs: Align doc Co-authored-by: Harshdeep Singh (harshdsingh) <38904804+super-harsh@users.noreply.github.com> * Update .github/workflows/create-release-official.yml * chore: Be more explict Co-authored-by: Bevan Arps <bevan.arps@outlook.com> * fix: Wording should not contain latest Co-authored-by: Bevan Arps <bevan.arps@outlook.com> * PR feedback * chore: Change workflow trigger --------- Co-authored-by: Harshdeep Singh (harshdsingh) <38904804+super-harsh@users.noreply.github.com> Co-authored-by: Bevan Arps <bevan.arps@outlook.com>
- Loading branch information
1 parent
69cf318
commit 8695695
Showing
4 changed files
with
136 additions
and
61 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,75 @@ | ||
name: Create new experimental release | ||
|
||
on: | ||
# run when pushed to main is published, | ||
# which creates a new tag | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'v2/**' | ||
# no content, allows manual triggering | ||
workflow_dispatch: | ||
|
||
env: | ||
ARTIFACT_VERSION: experimental | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # required to access tags | ||
submodules: "true" | ||
|
||
- name: Build & run devcontainer image | ||
# this always builds a new image from scratch rather than from the build-devcontainer-image workflow output | ||
# so that we pick up the latest versions of everything | ||
# NB: if you update this also update live-validation.yml, pre-release-tests.yaml and create-release-official.yaml | ||
id: devcontainer | ||
run: | | ||
docker build --tag devcontainer:latest .devcontainer | ||
mkdir -p $HOME/.docker # in case it doesn't exist | ||
container_id=$(docker create -w /workspace -v $GITHUB_WORKSPACE:/workspace -v /var/run/docker.sock:/var/run/docker.sock devcontainer:latest) | ||
docker start "$container_id" | ||
echo "container_id=$container_id" >> $GITHUB_ENV | ||
- name: Build required release files | ||
run: | | ||
container_id=${{env.container_id}} | ||
docker exec "$container_id" task VERSION=${{ env.ARTIFACT_VERSION }} LATEST_VERSION_TAG=${{ env.ARTIFACT_VERSION }} make-release-artifacts | ||
- name: Upload release assets | ||
uses: svenstaro/upload-release-action@7319e4733ec7a184d739a6f412c40ffc339b69c7 # this is v2.5.0, but pinned | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: refs/tags/${{ env.ARTIFACT_VERSION }} | ||
file: "v2/out/release/*" | ||
file_glob: true | ||
prerelease: true | ||
overwrite: true | ||
release_name: "Experimental" | ||
body: | | ||
This is an experimental release which containing the most recent commits from the main branch as of commit: ${{ github.sha }}. | ||
**This release might not be stable. Use at your own risk.** | ||
It is only intended for developers wishing to try out the latest feature, some of which may not be fully implemented. | ||
- name: Docker login | ||
run: | | ||
container_id=${{env.container_id}} | ||
docker exec -e AZURE_CLIENT_ID -e AZURE_CLIENT_SECRET -e DOCKER_REGISTRY "$container_id" task VERSION=${{ env.ARTIFACT_VERSION }} LATEST_VERSION_TAG=${{ env.ARTIFACT_VERSION }} docker-login | ||
env: | ||
DOCKER_REGISTRY: ${{ secrets.REGISTRY_LOGIN }} | ||
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | ||
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | ||
|
||
- name: Build, tag and push docker image | ||
run: | | ||
container_id=${{env.container_id}} | ||
docker exec -e DOCKER_PUSH_TARGET "$container_id" task VERSION=${{ env.ARTIFACT_VERSION }} LATEST_VERSION_TAG=${{ env.ARTIFACT_VERSION }} controller:docker-push-multiarch | ||
env: | ||
DOCKER_PUSH_TARGET: ${{ secrets.REGISTRY_PUBLIC }} |
118 changes: 59 additions & 59 deletions
118
.github/workflows/create-release.yml → ...hub/workflows/create-release-official.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 |
---|---|---|
@@ -1,59 +1,59 @@ | ||
name: Create new release | ||
|
||
on: | ||
# run when a release is published, | ||
# which creates a new tag | ||
push: | ||
tags: | ||
- v2* | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # required to access tags | ||
submodules: "true" | ||
|
||
- name: Build & run devcontainer image | ||
# this always builds a new image from scratch rather than from the build-devcontainer-image workflow output | ||
# so that we pick up the latest versions of everything | ||
# NB: if you update this also update live-validation.yml | ||
id: devcontainer | ||
run: | | ||
docker build --tag devcontainer:latest .devcontainer | ||
mkdir -p $HOME/.docker # in case it doesn't exist | ||
container_id=$(docker create -w /workspace -v $GITHUB_WORKSPACE:/workspace -v /var/run/docker.sock:/var/run/docker.sock devcontainer:latest) | ||
docker start "$container_id" | ||
echo "container_id=$container_id" >> $GITHUB_ENV | ||
- name: Build required release files | ||
run: | | ||
container_id=${{env.container_id}} | ||
docker exec "$container_id" task make-release-artifacts | ||
- name: Upload release assets | ||
uses: svenstaro/upload-release-action@7319e4733ec7a184d739a6f412c40ffc339b69c7 # this is v2.5.0, but pinned | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ github.ref }} | ||
file: "v2/out/release/*" | ||
file_glob: true | ||
|
||
- name: Docker login | ||
run: | | ||
container_id=${{env.container_id}} | ||
docker exec -e AZURE_CLIENT_ID -e AZURE_CLIENT_SECRET -e DOCKER_REGISTRY "$container_id" task docker-login | ||
env: | ||
DOCKER_REGISTRY: ${{ secrets.REGISTRY_LOGIN }} | ||
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | ||
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | ||
|
||
- name: Build, tag and push docker image | ||
run: | | ||
container_id=${{env.container_id}} | ||
docker exec -e DOCKER_PUSH_TARGET "$container_id" task controller:docker-push-multiarch | ||
env: | ||
DOCKER_PUSH_TARGET: ${{ secrets.REGISTRY_PUBLIC }} | ||
name: Create new official release | ||
|
||
on: | ||
# run when a release is published, | ||
# which creates a new tag | ||
push: | ||
tags: | ||
- v2* | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # required to access tags | ||
submodules: "true" | ||
|
||
- name: Build & run devcontainer image | ||
# this always builds a new image from scratch rather than from the build-devcontainer-image workflow output | ||
# so that we pick up the latest versions of everything | ||
# NB: if you update this also update live-validation.yml, pre-release-tests.yaml and create-release-experimental.yml | ||
id: devcontainer | ||
run: | | ||
docker build --tag devcontainer:latest .devcontainer | ||
mkdir -p $HOME/.docker # in case it doesn't exist | ||
container_id=$(docker create -w /workspace -v $GITHUB_WORKSPACE:/workspace -v /var/run/docker.sock:/var/run/docker.sock devcontainer:latest) | ||
docker start "$container_id" | ||
echo "container_id=$container_id" >> $GITHUB_ENV | ||
- name: Build required release files | ||
run: | | ||
container_id=${{env.container_id}} | ||
docker exec "$container_id" task make-release-artifacts | ||
- name: Upload release assets | ||
uses: svenstaro/upload-release-action@7319e4733ec7a184d739a6f412c40ffc339b69c7 # this is v2.5.0, but pinned | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ github.ref }} | ||
file: "v2/out/release/*" | ||
file_glob: true | ||
|
||
- name: Docker login | ||
run: | | ||
container_id=${{env.container_id}} | ||
docker exec -e AZURE_CLIENT_ID -e AZURE_CLIENT_SECRET -e DOCKER_REGISTRY "$container_id" task docker-login | ||
env: | ||
DOCKER_REGISTRY: ${{ secrets.REGISTRY_LOGIN }} | ||
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | ||
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | ||
|
||
- name: Build, tag and push docker image | ||
run: | | ||
container_id=${{env.container_id}} | ||
docker exec -e DOCKER_PUSH_TARGET "$container_id" task controller:docker-push-multiarch | ||
env: | ||
DOCKER_PUSH_TARGET: ${{ secrets.REGISTRY_PUBLIC }} |
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