From d0b70ea6df06a58a95d283711651e52101455f23 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Fri, 13 Dec 2019 12:00:45 -0500 Subject: [PATCH] upload assets from gitlab CI to github on a tagged release also disables travis asset uploading --- .gitlab-ci.yml | 63 +++++++++++++++++++++++++++++--------------------- .travis.yml | 20 ++++++++-------- 2 files changed, 47 insertions(+), 36 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 96c4c8571..241a4d6b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -134,8 +134,9 @@ build:windows: - dist/lbrynet.exe --version -# upload could be done by making it a yaml alias and putting it right into the build step. that way if one OS fails, the others still get uploaded -.upload: +# s3 = upload asset to s3 (build.lbry.io) +# could be done by making it a yaml alias and putting it right into the build step. that way if one OS fails, the others still get uploaded +.s3: stage: release variables: GIT_STRATEGY: none @@ -146,34 +147,44 @@ build:windows: aws s3 cp lbrynet-${OS}.zip s3://${ARTIFACTS_BUCKET}/${S3_PATH}/lbrynet-${OS}.zip s3:linux: - extends: .upload - variables: - OS: linux - dependencies: - - build:linux + extends: .s3 + variables: {OS: linux} + dependencies: ["build:linux"] s3:mac: - extends: .upload - variables: - OS: mac - dependencies: - - build:mac + extends: .s3 + variables: {OS: mac} + dependencies: ["build:mac"] s3:windows: - extends: .upload + extends: .s3 + variables: {OS: windows} + dependencies: ["build:windows"] + +# release = upload assets to github when there's a tagged release +.release: + stage: release + rules: + - if: '$CI_COMMIT_TAG =~ /^v[0-9\.]+$/' + when: on_success variables: - OS: windows - dependencies: - - build:windows + GIT_STRATEGY: none + script: + - pip install githubrelease + - githubrelease --no-progress --github-token ${GITHUB_CI_USER_ACCESS_TOKEN} asset lbryio/lbry-sdk upload ${CI_COMMIT_TAG} lbrynet-${OS}.zip -#release:linux: -# stage: release -# only: [tags] -# variables: -# OS: linux -# GIT_STRATEGY: none -# dependencies: [build:linux] -# script: -# - pip install githubrelease -# - githubrelease asset lbryio/lbry-sdk upload ${CI_COMMIT_TAG} lbrynet-${OS}.zip +release:linux: + extends: .release + variables: {OS: linux} + dependencies: ["build:linux"] + +release:mac: + extends: .release + variables: {OS: mac} + dependencies: ["build:mac"] + +release:windows: + extends: .release + variables: {OS: windows} + dependencies: ["build:windows"] diff --git a/.travis.yml b/.travis.yml index 41536c126..71c2a885e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,16 +70,16 @@ jobs: - aws configure set region us-east-1 - export S3_PATH="daemon/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}_branch-${TRAVIS_BRANCH}$([ ! -z ${TRAVIS_TAG} ] && echo _tag-${TRAVIS_TAG})" - aws s3 cp lbrynet-${OS}.zip s3://build.lbry.io/${S3_PATH}/lbrynet-${OS}.zip - deploy: - provider: releases - api_key: - secure: "unnR+aSJ1937Cl1PyBBZzGuZvV5W5TGcXELhXTgyOeeI6FgO/j80qmbNxJDA7qdFH/hvVicQFWoflhZu2dxN5rYP5BQJW3q3XoOLY3XAc1s1vicFkwqn3TIfdFiJTz+/D9eBUBBhHKeYFxm3M+thvklTLgjKl6fflh14NfGuNTevK9yQke8wewW3f9UmFTo1qNOPF1OsTZRbwua6oQYa59P+KukoPt4Dsu1VtILtTkj7hfEsUL79cjotwO3gkhYftxbl/xeDSZWOt+9Nhb8ZKmQG/uDx4JiTMm5lWRk4QB7pUujZ1CftxCYWz/lJx9nuJpdCOgP624tcHymErNlD+vGLwMTNslcXGYkAJH6xvGyxBJ+Obc8vRVnZbRM26BfH34TcPK1ueRxHSrDUbzMIIUsgcoZAxBuim8uDPp+K7bGqiygzSs2vQfr9U5Jhe9/F8sPdtNctfJZEfgmthNTeVFjyNsGIfIt754uGSfACqM7wDLh6fbKx7M+FHlNyOdvYCrbKUOAYXmTikYIpVDvlaaeMO+N+uW8Rhvm1j+JU7CVwhMavLySaPVc6Dt5OxiMMmxw9mVrjW9bBPjS5AkrS5MOA13T5wapoLzH6+gE92U4HzA6ilMcwRaQPSFnK2JU7tzyt2Wy1PH4MjHowXI2WyICG1x510dD3tX1P/1px8ro=" - file: lbrynet-${OS}.zip - skip_cleanup: true - overwrite: true - draft: true - on: - tags: true +# deploy: +# provider: releases +# api_key: +# secure: "unnR+aSJ1937Cl1PyBBZzGuZvV5W5TGcXELhXTgyOeeI6FgO/j80qmbNxJDA7qdFH/hvVicQFWoflhZu2dxN5rYP5BQJW3q3XoOLY3XAc1s1vicFkwqn3TIfdFiJTz+/D9eBUBBhHKeYFxm3M+thvklTLgjKl6fflh14NfGuNTevK9yQke8wewW3f9UmFTo1qNOPF1OsTZRbwua6oQYa59P+KukoPt4Dsu1VtILtTkj7hfEsUL79cjotwO3gkhYftxbl/xeDSZWOt+9Nhb8ZKmQG/uDx4JiTMm5lWRk4QB7pUujZ1CftxCYWz/lJx9nuJpdCOgP624tcHymErNlD+vGLwMTNslcXGYkAJH6xvGyxBJ+Obc8vRVnZbRM26BfH34TcPK1ueRxHSrDUbzMIIUsgcoZAxBuim8uDPp+K7bGqiygzSs2vQfr9U5Jhe9/F8sPdtNctfJZEfgmthNTeVFjyNsGIfIt754uGSfACqM7wDLh6fbKx7M+FHlNyOdvYCrbKUOAYXmTikYIpVDvlaaeMO+N+uW8Rhvm1j+JU7CVwhMavLySaPVc6Dt5OxiMMmxw9mVrjW9bBPjS5AkrS5MOA13T5wapoLzH6+gE92U4HzA6ilMcwRaQPSFnK2JU7tzyt2Wy1PH4MjHowXI2WyICG1x510dD3tX1P/1px8ro=" +# file: lbrynet-${OS}.zip +# skip_cleanup: true +# overwrite: true +# draft: true +# on: +# tags: true - <<: *build name: "Mac"