diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml index 8a57aeb..2764ca6 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/blank.yml @@ -21,6 +21,34 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Tests + run: | + echo $GITHUB_REF + echo ${{ github.ref }} + echo ${{ github.ref_name }} + echo ${{ github.head_ref }} + echo ${{ github.base_ref }} + echo ${{ github.repository }} + echo $GITHUB_REPOSITORY + + echo "******** BINDER *********" + git checkout binder + ls + echo ${{ github.sha }} > sha1.txt + git add sha1.txt + git config user.name "Binder Bot" + git commit -m "edit sha1" + git push origin binder + + + echo "******** CURRENT REF *********" + LOCAL_REF=${GITHUB_REF/refs\//} + echo LOCAL_REF=$LOCAL_REF + git checkout ${LOCAL_REF} + ls - name: Set env variables for github+binder links in doc run: | @@ -53,6 +81,8 @@ jobs: echo ${AUTODOC_NOTEBOOKS_REPO_URL} echo ${AUTODOC_NOTEBOOKS_BRANCH} + echo nb_branch: ${{ env.AUTODOC_NOTEBOOKS_BRANCH }} + # Runs a single command using the runners shell - name: Run a one-line script run: echo ${{ github.ref }} @@ -65,4 +95,3 @@ jobs: - name: deploy if: ${{ github.ref == 'refs/heads/main' }} run: echo deploy - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7a9b44..d60ccf2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,39 +10,52 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on + create-binder-env: runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Get scikit-decide release version and define new binder env tag + run: | + TAG_NAME=${GITHUB_REF/refs\/tags\//} # stripping "refs/tags/" + SKDECIDE_VERSION=${TAG_NAME/v/} # stripping "v" + BINDER_TAG=binder_${TAG_NAME} + echo "BINDER_TAG=${BINDER_TAG}" >> $GITHUB_ENV + echo "SKDECIDE_VERSION=${SKDECIDE_VERSION}" >> $GITHUB_ENV + + # Checks-out binder branch - uses: actions/checkout@v2 + with: + ref: binder + - name: Update scikit-decide dependency and tag the environement + run: | + sed -e "s/scikit-decide\[all\]==.*/scikit-decide\[all\]==${SKDECIDE_VERSION}/" environment.yml > environment.yml.new + mv environment.yml.new environment.yml + git config user.name "Binder Bot" + git config user.email "binder@bot.com" + git commit environment.yml -m "Update scikit-decide dependency" + git tag -a ${BINDER_TAG} -m "Release binder environment for scikit-decide ${SKDECIDE_VERSION}" + git push origin ${BINDER_TAG} + + - name: cache binder build on mybinder.org + uses: jupyterhub/repo2docker-action@master + with: + NO_PUSH: true + MYBINDERORG_TAG: ${{ env.BINDER_TAG }} + + build-docs: + runs-on: ubuntu-latest + env: + DOCS_VERSION_PATH: / + + steps: - name: Set env variables for github+binder links in doc run: | - # binder environment repo and branch - AUTODOC_BINDER_ENV_GH_REPO_NAME="airbus/scikit-decide" - AUTODOC_BINDER_ENV_GH_BRANCH="binder" - # notebooks source repo and branch depending if it is a commit push or a PR - if [[ $GITHUB_REF == refs/pull* ]]; - then - AUTODOC_NOTEBOOKS_REPO_URL="${GITHUB_SERVER_URL}/${{ github.event.pull_request.head.repo.full_name }}" - AUTODOC_NOTEBOOKS_BRANCH=${GITHUB_HEAD_REF} - elif [[ $GITHUB_REF == refs/heads* ]]; - then - AUTODOC_NOTEBOOKS_REPO_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} - AUTODOC_NOTEBOOKS_BRANCH=${GITHUB_REF/refs\/heads\//} - fi - # export in GITHUB_ENV for next steps - echo "AUTODOC_BINDER_ENV_GH_REPO_NAME=${AUTODOC_BINDER_ENV_GH_REPO_NAME}" >> $GITHUB_ENV - echo "AUTODOC_BINDER_ENV_GH_BRANCH=${AUTODOC_BINDER_ENV_GH_BRANCH}" >> $GITHUB_ENV - echo "AUTODOC_NOTEBOOKS_REPO_URL=${AUTODOC_NOTEBOOKS_REPO_URL}" >> $GITHUB_ENV - echo "AUTODOC_NOTEBOOKS_BRANCH=${AUTODOC_NOTEBOOKS_BRANCH}" >> $GITHUB_ENV - # check computed variables - echo "Binder env: ${AUTODOC_BINDER_ENV_GH_REPO_NAME}/${AUTODOC_BINDER_ENV_GH_BRANCH}" - echo "Notebooks source: ${AUTODOC_NOTEBOOKS_REPO_URL}/tree/${AUTODOC_NOTEBOOKS_BRANCH}" + TAG_NAME=${GITHUB_REF/refs\/tags\//} # stripping "refs/tags/" + BINDER_TAG=binder_${TAG_NAME} + echo "AUTODOC_BINDER_ENV_GH_REPO_NAME=airbus/scikit-decide" >> $GITHUB_ENV + echo "AUTODOC_BINDER_ENV_GH_BRANCH=${BINDER_TAG}" >> $GITHUB_ENV + echo "AUTODOC_NOTEBOOKS_REPO_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" >> $GITHUB_ENV + echo "AUTODOC_NOTEBOOKS_BRANCH=${TAG_NAME}" >> $GITHUB_ENV - name: read binder env run: | @@ -50,17 +63,3 @@ jobs: echo ${AUTODOC_BINDER_ENV_GH_BRANCH} echo ${AUTODOC_NOTEBOOKS_REPO_URL} echo ${AUTODOC_NOTEBOOKS_BRANCH} - - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo ${{ github.ref }} - - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. - - name: deploy - if: ${{ github.ref == 'refs/heads/main' }} - run: echo deploy - diff --git a/another b/another new file mode 100644 index 0000000..e69de29 diff --git a/anotherone b/anotherone new file mode 100644 index 0000000..e69de29 diff --git a/ko b/ko new file mode 100644 index 0000000..e69de29 diff --git a/newfile b/newfile new file mode 100644 index 0000000..e69de29 diff --git a/yo b/yo new file mode 100644 index 0000000..e69de29 diff --git a/yoyo b/yoyo new file mode 100644 index 0000000..e69de29