diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0395e726..4cf422e24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,10 +80,15 @@ jobs: - name: Release if: "contains(github.event.head_commit.message, '[release]')" run: | - bash typespec/tag-and-push-docs.sh + bash tag-and-push.sh env: + GRADLE_OPTS: '-Dorg.gradle.daemon=false' + AWS_ACCESS_KEY_ID: ${{secrets.TOWER_CI_AWS_ACCESS}} + AWS_SECRET_ACCESS_KEY: ${{secrets.TOWER_CI_AWS_SECRET}} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PAT: ${{ secrets.DOCKER_PAT }} + QUAY_PAT: ${{ secrets.QUAY_PAT }} + GITHUB_TOKEN: ${{ secrets.GH_SEQERA_TOKEN }} - name: Publish tests report if: failure() diff --git a/.github/workflows/typespec.yml b/.github/workflows/typespec.yml index 44c08535f..e8491b951 100644 --- a/.github/workflows/typespec.yml +++ b/.github/workflows/typespec.yml @@ -37,3 +37,13 @@ jobs: cd typespec tsp install tsp compile . + + - name: Release + if: "contains(github.event.head_commit.message, '[release-docs]')" + run: | + bash typespec/tag-and-push-docs.sh + env: + GRADLE_OPTS: '-Dorg.gradle.daemon=false' + AWS_ACCESS_KEY_ID: ${{secrets.TOWER_CI_AWS_ACCESS}} + AWS_SECRET_ACCESS_KEY: ${{secrets.TOWER_CI_AWS_SECRET}} + GITHUB_TOKEN: ${{ secrets.GH_SEQERA_TOKEN }} diff --git a/typespec/tag-and-push-docs.sh b/typespec/tag-and-push-docs.sh index 38afb0c8b..67ea6f897 100755 --- a/typespec/tag-and-push-docs.sh +++ b/typespec/tag-and-push-docs.sh @@ -21,17 +21,20 @@ set -e set -x +SED=sed +[[ $(uname) == Darwin ]] && SED=gsed -npm install -g @typespec/compiler +RELEASE=${RELEASE:-$(git show -s --format='%s' | $SED -rn 's/.*\[(release)\].*/\1/p')} +if [[ $RELEASE ]]; then + npm install -g @typespec/compiler -cd typespec -tsp install -tsp compile . + cd typespec -TAG=$(cat ../VERSION) + tsp install -docker build -t docker.io/hrma017/wave/openapi:$TAG . -echo "Build docker.io/wave/openapi:$TAG" + tsp compile . -docker push docker.io/hrma017/wave/openapi:$TAG -echo "Pushed docker.io/hrma017/wave/openapi:$TAG" + docker build -t 195996028523.dkr.ecr.eu-west-1.amazonaws.com/wave/wave-docs:$VERSION . + + docker push 195996028523.dkr.ecr.eu-west-1.amazonaws.com/wave/wave-docs:$VERSION +fi