Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
retzero authored Sep 7, 2020
1 parent 0cca7c1 commit 2b1d429
Showing 1 changed file with 8 additions and 32 deletions.
40 changes: 8 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ jobs:
outputs:
studio_version: ${{ steps.version_envs.outputs.STUDIO_VERSION }}
tizen_version: ${{ steps.version_envs.outputs.TIZEN_VERSION }}
tag_name: ${{ steps.version_envs.outputs.TAG_NAME }}
wide_tag: ${{ steps.version_envs.outputs.WIDE_TAG }}
steps:
- name: Set env
id: version_envs
run: |
echo ::set-output name=STUDIO_VERSION::$(echo ${GITHUB_REF##*/} | cut -c 2- | cut -d'-' -f1)
echo ::set-output name=TIZEN_VERSION::$(echo ${GITHUB_REF##*/} | cut -c 2- | cut -d'-' -f2)
echo ::set-output name=TAG_NAME::$(echo ${GITHUB_REF##*/} | cut -c 2-)
echo ::set-output name=WIDE_TAG::$(echo ${GITHUB_REF##*/} | cut -c 2- | awk -F'-' '{print $1"-"$2}')
docker_build:
name: Build docker image
Expand All @@ -32,46 +33,21 @@ jobs:
- name: Build docker image for tags
uses: docker/build-push-action@v1
with:
repository: retzero/tizen-studio
tags: latest,${{ needs.prepare_env.outputs.studio_version }}
repository: temp/workflow
tags: foo
push: false
build_args: STUDIO_VERSION=${{ needs.prepare_env.outputs.studio_version }},TIZEN_VERSION=${{ needs.prepare_env.outputs.tizen_version }}

- name: Run image from registry
run: |
k=$(docker run --rm -i retzero/tizen-studio:3.7-5.0 tizen version)
k=$(docker run --rm -i temp/workflow:foo tizen version)
if [[ "${k%$'\r'}" != "Tizen CLI "* ]]; then exit 1; fi
- name: Push docker image to docker hub
uses: docker/build-push-action@v1
with:
#username: ${{ secrets.DOCKER_USERNAME }}
#password: ${{ secrets.DOCKER_PASSWORD }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: retzero/tizen-studio
tags: latest,${{ needs.prepare_env.outputs.studio_version }}
tags: ${{ needs.prepare_env.outputs.wide_tag }},${{ needs.prepare_env.outputs.tag_name }}
build_args: STUDIO_VERSION=${{ needs.prepare_env.outputs.studio_version }},TIZEN_VERSION=${{ needs.prepare_env.outputs.tizen_version }}

# - name: Store intermediate docker image
# run: docker save -o workflow-foo.tar localhost:5000/temp/workflow:foo
#
# - name: Store intermediate docker image
# uses: actions/upload-artifact@v2
# with:
# name: docker_tarball
# path: workflow-foo.tar

# verify_image:
# name: Verify docker image
# runs-on: ubuntu-latest
# needs: [prepare_env, docker_build]
# steps:
# - name: Retrieve intermediate docker tarball
# uses: actions/download-artifact@v2
# with:
# name: docker_tarball
#
# - name: Load docker image
# run: docker load -i workflow-foo.tar
#
# - name: Run image from registry
# run: docker run --rm -i localhost:5000/temp/workflow:foo cat ./tizen_version.txt

0 comments on commit 2b1d429

Please sign in to comment.