Skip to content

Commit 010da6a

Browse files
Refactor Github Action per b/485167538 (#2164)
Co-authored-by: Ben Knutson <benknutson@google.com>
1 parent e42be7b commit 010da6a

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ jobs:
252252
sudo apt-get autoclean -y
253253
df -h
254254
#export BAZEL_OPTIMIZATION="--config=optimization --config=linux_ci --config=cache"
255-
#if [[ "${{ env.EVENT_NAME }}" == "push" && "${{ env.REPO_NAME }}" == "tensorflow/io" ]]; then
255+
#if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
256256
# export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_upload_local_results=true --google_credentials=service_account_creds.json"
257257
#fi
258258
TENSORFLOW_VERSION=$(grep tensorflow tensorflow_io/python/ops/version_ops.py | sed -e "s/require = //g" | awk -F, '{print $1}' | awk -F= '{print $2}' | awk -F. '{print $1"."$2}')

.github/workflows/release.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ jobs:
2525
fetch-depth: 0
2626
- run: |
2727
set -x -e
28-
COMMIT=$(git rev-parse --quiet --verify ${{ github.event.inputs.commit }})
29-
if [[ "$(git tag -l ${{ github.event.inputs.version }})" == "${{ github.event.inputs.version }}" ]]; then
30-
echo "${{ github.event.inputs.version }} already released"
28+
COMMIT=$(git rev-parse --quiet --verify ${GITHUB_EVENT_INPUTS_COMMIT})
29+
if [[ "$(git tag -l ${GITHUB_EVENT_INPUTS_VERSION})" == "${GITHUB_EVENT_INPUTS_VERSION}" ]]; then
30+
echo "${GITHUB_EVENT_INPUTS_VERSION} already released"
3131
exit 1
3232
fi
33-
VERSION=${{ github.event.inputs.version }}
33+
VERSION=${GITHUB_EVENT_INPUTS_VERSION}
3434
3535
docker pull tfsigio/candidate:${VERSION:1}
3636
docker create -it --name storage tfsigio/candidate:${VERSION:1} bash
@@ -57,12 +57,19 @@ jobs:
5757
echo "::set-output name=name::TensorFlow I/O ${VERSION:1}"
5858
echo "::set-output name=commit::${COMMIT}"
5959
id: info
60+
env:
61+
GITHUB_EVENT_INPUTS_COMMIT: ${{ github.event.inputs.commit }}
62+
GITHUB_EVENT_INPUTS_VERSION: ${{ github.event.inputs.version }}
6063
- run: |
6164
set -x -e
62-
echo ${{ steps.info.outputs.tag }}
63-
echo ${{ steps.info.outputs.name }}
64-
echo ${{ steps.info.outputs.commit }}
65+
echo ${STEPS_INFO_OUTPUTS_TAG}
66+
echo ${STEPS_INFO_OUTPUTS_NAME}
67+
echo ${STEPS_INFO_OUTPUTS_COMMIT}
6568
cat CURRENT.md
69+
env:
70+
STEPS_INFO_OUTPUTS_TAG: ${{ steps.info.outputs.tag }}
71+
STEPS_INFO_OUTPUTS_NAME: ${{ steps.info.outputs.name }}
72+
STEPS_INFO_OUTPUTS_COMMIT: ${{ steps.info.outputs.commit }}
6673
- uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
6774
with:
6875
body_path: CURRENT.md

0 commit comments

Comments
 (0)