Bumps the github-actions-updates group with 5 updates: | Package | From | To | | --- | --- | --- | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.4.3` | `4.6.2` | | [github/codeql-action](https://github.com/github/codeql-action) | `3.28.11` | `3.28.12` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `4.1.8` | `4.2.1` | | [tj-actions/changed-files](https://github.com/tj-actions/changed-files) | `531f5f7d163941f0c1c04e0ff4d8bb243ac4366f` | `27ae6b33eaed7bf87272fdeb9f1c54f9facc9d99` | | [getsentry/action-release](https://github.com/getsentry/action-release) | `3.1.0` | `3.1.1` | Updates `actions/upload-artifact` from 4.4.3 to 4.6.2 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4.4.3...ea165f8d65b6e75b540449e92b4886f43607fa02) Updates `github/codeql-action` from 3.28.11 to 3.28.12 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v3.28.11...5f8171a638ada777af81d42b55959a643bb29017) Updates `actions/download-artifact` from 4.1.8 to 4.2.1 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4.1.8...95815c38cf2ff2164869cbab79da8d1f422bc89e) Updates `tj-actions/changed-files` from 531f5f7d163941f0c1c04e0ff4d8bb243ac4366f to 27ae6b33eaed7bf87272fdeb9f1c54f9facc9d99 - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](531f5f7d16...27ae6b33ea) Updates `getsentry/action-release` from 3.1.0 to 3.1.1 - [Release notes](https://github.com/getsentry/action-release/releases) - [Changelog](https://github.com/getsentry/action-release/blob/master/CHANGELOG.md) - [Commits](fa247637f7...00ed2a6cc2) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-updates - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions-updates - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-updates - dependency-name: tj-actions/changed-files dependency-type: direct:production dependency-group: github-actions-updates - dependency-name: getsentry/action-release dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions-updates ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
183 строки
7.4 KiB
YAML
183 строки
7.4 KiB
YAML
name: Server CI Artifacts
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows:
|
|
- "Server CI PR"
|
|
types:
|
|
- completed
|
|
|
|
env:
|
|
COSIGN_VERSION: 2.2.0
|
|
|
|
jobs:
|
|
## We only need the condition on the first job
|
|
## This will run only when a pull request is created with server changes
|
|
update-initial-status:
|
|
if: github.repository_owner == 'mattermost' && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: mattermost/actions/delivery/update-commit-status@fec7b836001c9380d4bfaf28d443945c103a098c
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
repository_full_name: ${{ github.repository }}
|
|
commit_sha: ${{ github.event.workflow_run.head_sha }}
|
|
context: Server CI/Artifacts Build
|
|
description: Artifacts upload and build for mattermost team platform
|
|
status: pending
|
|
|
|
upload-artifacts:
|
|
runs-on: ubuntu-22.04
|
|
needs:
|
|
- update-initial-status
|
|
steps:
|
|
- name: cd/configure-aws-credentials
|
|
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
|
|
with:
|
|
aws-region: us-east-1
|
|
aws-access-key-id: ${{ secrets.PR_BUILDS_BUCKET_AWS_ACCESS_KEY_ID }}
|
|
aws-secret-access-key: ${{ secrets.PR_BUILDS_BUCKET_AWS_SECRET_ACCESS_KEY }}
|
|
|
|
- name: cd/download-artifacts-from-PR-workflow
|
|
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
|
|
with:
|
|
run-id: ${{ github.event.workflow_run.id }}
|
|
github-token: ${{ github.token }}
|
|
name: server-dist-artifact
|
|
path: server/dist
|
|
|
|
- name: cd/generate-packages-file-list
|
|
working-directory: ./server/dist
|
|
run: |
|
|
echo "PACKAGES_FILE_LIST<<EOF" >> "${GITHUB_ENV}"
|
|
ls | grep -E "*.(tar.gz|zip)$" >> "${GITHUB_ENV}"
|
|
echo "EOF" >> "${GITHUB_ENV}"
|
|
|
|
- name: cd/upload-artifacts-to-s3
|
|
run: aws s3 sync server/dist/ s3://pr-builds.mattermost.com/mattermost/commit/${{ github.event.workflow_run.head_sha }}/ --cache-control no-cache --no-progress --acl public-read
|
|
|
|
- name: cd/generate-summary
|
|
run: |
|
|
echo "### Download links for Mattermost team package" >> "${GITHUB_STEP_SUMMARY}"
|
|
echo " " >> "${GITHUB_STEP_SUMMARY}"
|
|
echo "Mattermost Repo SHA: \`${{ github.event.workflow_run.head_sha }}\`" >> "${GITHUB_STEP_SUMMARY}"
|
|
echo "|Download Link|" >> "${GITHUB_STEP_SUMMARY}"
|
|
echo "| --- |" >> "${GITHUB_STEP_SUMMARY}"
|
|
for package in ${PACKAGES_FILE_LIST}
|
|
do
|
|
echo "|[${package}](https://pr-builds.mattermost.com/mattermost/commit/${{ github.event.workflow_run.head_sha }}/${package})|" >> "${GITHUB_STEP_SUMMARY}"
|
|
done
|
|
|
|
build-docker:
|
|
runs-on: ubuntu-22.04
|
|
needs:
|
|
- upload-artifacts
|
|
outputs:
|
|
TAG: ${{ steps.set_tag.outputs.TAG }}
|
|
steps:
|
|
- name: cd/docker-login
|
|
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
|
with:
|
|
username: mattermostdev
|
|
password: ${{ secrets.DOCKERHUB_DEV_TOKEN }}
|
|
|
|
- name: cd/setup-cosign
|
|
uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3.8.1
|
|
with:
|
|
cosign-release: v${{ env.COSIGN_VERSION }}
|
|
|
|
- name: cd/download-artifacts-from-PR-workflow
|
|
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
|
|
with:
|
|
run-id: ${{ github.event.workflow_run.id }}
|
|
github-token: ${{ github.token }}
|
|
name: server-build-artifact
|
|
path: server/build/
|
|
|
|
- name: cd/setup-docker-buildx
|
|
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
|
|
|
|
- name: cd/set-docker-tag
|
|
id: set_tag
|
|
run: |
|
|
echo "TAG=$(echo '${{ github.event.workflow_run.head_sha }}' | cut -c1-7)" >> $GITHUB_OUTPUT
|
|
|
|
- name: cd/docker-build-and-push
|
|
id: docker
|
|
env:
|
|
MM_PACKAGE: https://pr-builds.mattermost.com/mattermost/commit/${{ github.event.workflow_run.head_sha }}/mattermost-team-linux-amd64.tar.gz
|
|
TAG: ${{ steps.set_tag.outputs.TAG }}
|
|
run: |
|
|
cd server/build
|
|
docker buildx build --no-cache --platform linux/amd64 --push --build-arg MM_PACKAGE=${MM_PACKAGE} -t mattermostdevelopment/mm-te-test:${TAG} -t mattermostdevelopment/mattermost-team-edition:${TAG} .
|
|
echo "DOCKERHUB_IMAGE_DIGEST=$(cosign triangulate mattermostdevelopment/mattermost-team-edition:${TAG} | cut -d: -f2 | sed 's/\.sig$//' | tr '-' ':')" >> "${GITHUB_OUTPUT}"
|
|
|
|
- name: cd/generate-summary
|
|
env:
|
|
TAG: ${{ steps.set_tag.outputs.TAG }}
|
|
run: |
|
|
echo "### Docker Image for Mattermost team package" >> "${GITHUB_STEP_SUMMARY}"
|
|
echo " " >> "${GITHUB_STEP_SUMMARY}"
|
|
echo "Mattermost Repo SHA: \`${{ github.event.workflow_run.head_sha }}\`" >> "${GITHUB_STEP_SUMMARY}"
|
|
echo " " >> "${GITHUB_STEP_SUMMARY}"
|
|
echo "Docker Image: \`mattermostdevelopment/mattermost-team-edition:${TAG}\`" >> "${GITHUB_STEP_SUMMARY}"
|
|
echo "Image Digest: \`${{ steps.docker.outputs.DOCKERHUB_IMAGE_DIGEST }}\`" >> "${GITHUB_STEP_SUMMARY}"
|
|
echo "Secure Image: \`mattermostdevelopment/mattermost-team-edition:${TAG}@${{ steps.docker.outputs.DOCKERHUB_IMAGE_DIGEST }}\`" >> "${GITHUB_STEP_SUMMARY}"
|
|
|
|
scan-docker-image:
|
|
runs-on: ubuntu-22.04
|
|
needs:
|
|
- build-docker
|
|
env:
|
|
POLICY: "DevOps Vulnerabilities Policy"
|
|
steps:
|
|
- name: cd/setup-wizcli
|
|
run: |
|
|
curl -o wizcli https://downloads.wiz.io/wizcli/latest/wizcli-linux-amd64
|
|
chmod +x wizcli
|
|
./wizcli auth --id "$WIZ_CLIENT_ID" --secret "$WIZ_CLIENT_SECRET"
|
|
env:
|
|
WIZ_CLIENT_ID: ${{ secrets.WIZ_DEVOPS_CLIENT_ID }}
|
|
WIZ_CLIENT_SECRET: ${{ secrets.WIZ_DEVOPS_CLIENT_SECRET }}
|
|
|
|
- name: cd/download-container-image
|
|
run: |
|
|
docker pull mattermostdevelopment/mattermost-team-edition:${{ needs.build-docker.outputs.TAG }}
|
|
|
|
- name: cd/scan-image
|
|
run: |
|
|
./wizcli docker scan --image mattermostdevelopment/mattermost-team-edition:${{ needs.build-docker.outputs.TAG }} --policy "$POLICY"
|
|
|
|
update-failure-final-status:
|
|
if: failure() || cancelled()
|
|
runs-on: ubuntu-22.04
|
|
needs:
|
|
- build-docker
|
|
steps:
|
|
- uses: mattermost/actions/delivery/update-commit-status@fec7b836001c9380d4bfaf28d443945c103a098c
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
repository_full_name: ${{ github.repository }}
|
|
commit_sha: ${{ github.event.workflow_run.head_sha }}
|
|
context: Server CI/Artifacts Build
|
|
description: Artifacts upload and build for mattermost team platform
|
|
status: failure
|
|
|
|
update-success-final-status:
|
|
if: success()
|
|
runs-on: ubuntu-22.04
|
|
needs:
|
|
- build-docker
|
|
steps:
|
|
- uses: mattermost/actions/delivery/update-commit-status@fec7b836001c9380d4bfaf28d443945c103a098c
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
repository_full_name: ${{ github.repository }}
|
|
commit_sha: ${{ github.event.workflow_run.head_sha }}
|
|
context: Server CI/Artifacts Build
|
|
description: Artifacts upload and build for mattermost team platform
|
|
status: success
|