Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 124.1.7 tag #4385

Merged
merged 7 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,18 @@ jobs:
- name: Build shell-ui container image
run: docker build . --tag shell-ui:v$SHELL_UI_VERSION
working-directory: shell-ui
- name: Extract shell folder from shell-ui container
run: |
docker create --name shell-ui shell-ui:v$SHELL_UI_VERSION
docker cp shell-ui:/usr/share/nginx/html/shell .
docker rm shell-ui
tar cvf shell.tar shell
- name: Save shell-ui container image
run: >
docker save shell-ui:v$SHELL_UI_VERSION |
gzip > shell-ui.tar.gz
- name: Prepare artifacts
run: mkdir -p "artifacts/images" && mv shell-ui.tar.gz artifacts/images/
run: mkdir -p "artifacts/images" && mv shell-ui.tar.gz artifacts/images/ && mv shell.tar artifacts/images/
- name: Upload artifacts
uses: scality/action-artifacts@v3
with:
Expand Down
59 changes: 39 additions & 20 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,15 @@ on:
required: true
ARTIFACTS_PASSWORD:
required: true
HARBOR_PROD_PROJECT:
required: true
HARBOR_DEV_PROJECT:
required: true

# Push on development branch = PR merge
push:
branches:
- "development/**"

env:
REGISTRY_HOST: registry.scality.com
REGISTRY_HOST: ghcr.io
REGISTRY_PROJECT: "${{ github.repository }}"
IS_STABLE: "false"
IS_LATEST: "false"

Expand All @@ -38,18 +35,14 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# NOTE: We fetch depth since fetch tags only does not works
# Sees: https://github.com/actions/checkout/issues/1471
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# "Compute" the harbor project to use
- name: Set registry project to Prod
if: inputs.is_production
run: echo "REGISTRY_PROJECT=${{ secrets.HARBOR_PROD_PROJECT }}" >> $GITHUB_ENV
- name: Set registry project to Dev
if: "! inputs.is_production"
run: echo "REGISTRY_PROJECT=${{ secrets.HARBOR_DEV_PROJECT }}" >> $GITHUB_ENV

# Retrieve Shell UI image from the build, load it and compute version
- name: Retrieve artifacts url
if: inputs.artifacts-url == ''
Expand All @@ -65,6 +58,10 @@ jobs:
run: >
curl --fail -LO -u ${{ secrets.ARTIFACTS_USER }}:${{ secrets.ARTIFACTS_PASSWORD }}
${{ inputs.artifacts-url || steps.artifacts.outputs.link }}/images/shell-ui.tar.gz
- name: Retrieve shell archive from artifacts
run: >
curl --fail -LO -u ${{ secrets.ARTIFACTS_USER }}:${{ secrets.ARTIFACTS_PASSWORD }}
${{ inputs.artifacts-url || steps.artifacts.outputs.link }}/images/shell.tar
- name: Load shell-ui image
run: docker load < shell-ui.tar.gz
- name: Retrieve product.txt from artifacts
Expand Down Expand Up @@ -107,14 +104,11 @@ jobs:
fi

# Tag shell-ui image before upload to registry
# (depending whether or not it's for production)
- name: Tag shell-ui image with current version
run: >
docker tag "shell-ui:v${{ env.SHELL_UI_VERSION }}"
"${{ env.REGISTRY_HOST }}/${{ env.REGISTRY_PROJECT }}/shell-ui:v${{ env.SHELL_UI_VERSION }}"
- name: Tag shell-ui image with commit short revision
# Only tag with commit short version when pushing on dev
if: "! inputs.is_production"
run: >
docker tag "shell-ui:v${{ env.SHELL_UI_VERSION }}"
"${{ env.REGISTRY_HOST }}/${{ env.REGISTRY_PROJECT }}/shell-ui:v${{ env.SHELL_UI_VERSION }}-${{ env.SHELL_UI_REF }}"
Expand All @@ -131,11 +125,36 @@ jobs:

# Push image to the registry
- name: Login to the registry
run: >
docker login "${{ env.REGISTRY_HOST }}"
--username "${{ secrets.REGISTRY_LOGIN }}" --password "${{ secrets.REGISTRY_PASSWORD }}"
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY_HOST }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push shell-ui images to the registry
run: >
docker push --all-tags
"${{ env.REGISTRY_HOST }}/${{ env.REGISTRY_PROJECT }}/shell-ui"

- name: Get tag message
if: inputs.is_production
id: get_tag_message
# Explicitly fetching tags since checkout fetch-tags does not works well
# Sees: https://github.com/actions/checkout/issues/1471
run: |-
git fetch --tags
echo "message<<EOF" >> $GITHUB_OUTPUT
git tag -l --format='%(contents)' "${{ env.SHELL_UI_VERSION }}" | tail -n +4 >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- uses: softprops/action-gh-release@v2
if: inputs.is_production
with:
name: Metalk8s ${{ env.SHELL_UI_VERSION }}
tag_name: ${{ env.SHELL_UI_VERSION }}
body: ${{ steps.get_tag_message.outputs.message }}
prerelease: "${{ ! fromJSON(env.IS_STABLE) }}"
draft: false
files: |
shell.tar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CHANGELOG
## Release 124.1.7 (in development)
## Release 124.1.8 (in development)

## Release 124.1.7

### Additions

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_MAJOR=124
VERSION_MINOR=1
VERSION_PATCH=7
VERSION_PATCH=8
VERSION_SUFFIX=-dev
Loading