Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for MySQL 5.7 #84

Merged
merged 8 commits into from
Nov 13, 2024
Merged

Conversation

abetomo
Copy link
Contributor

@abetomo abetomo commented Nov 11, 2024

We also tidied up the conditions for docker push with CI.

tags="${tags},groonga/mroonga:latest"
fi
echo "::set-output name=push::${push}"
echo "::set-output name=tags::${tags}"
- uses: actions/checkout@v4
- uses: docker/login-action@v3
if: ${{ steps.parse.outputs.push }} == 'true'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if: ${{ steps.parse.outputs.push }} == 'true'
if: steps.parse.outputs.push == 'true'

tags="${tags},groonga/mroonga:latest"
fi
echo "::set-output name=push::${push}"
echo "::set-output name=tags::${tags}"
- uses: actions/checkout@v4
- uses: docker/login-action@v3
if: steps.parse.outputs.push == 'true'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GITHUB_EVENT_NAMEpushのときだけsteps.parse.outputs.pushtrueにしてくれる?

;;
*)
version=${{ matrix.id }}-latest
push=false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これは維持して欲しい。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これをがんばらない方がいいのかな。

たぶん、タグとpushしたコミットの両方でpushするとエラーになるからこうしているんだと思うんだけど、それを無視すればいいっちゃいいんだよね。気持ち悪いけど。

case "${{ github.ref }}" in
refs/tags/*)
version=$(echo "${{ github.ref }}" | sed -e "s,^refs/tags/,,g")
version="${{ github.ref_name }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これもやっちゃうならcase "${{ github.ref }}" inも直しちゃう?

if [ "${GITHUB_REF_TYPE}" = "tag" ] -a [[ "${GITHUB_REF_NAME}" =~ "^${{ matrix.id }}\." ]]; then
  version="${GITHUB_REF_NAME}"
else
  version=${{ matrix.id }}-latest
fi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bashで正規表現メモ

パターンを " で囲むと正規表現として扱われないらしい。

$ bash -c '[[ "hoge.2" =~ ^hoge\. ]] && echo "true"'
true
$ bash -c '[[ "hoge.2" =~ "^hoge\." ]] && echo "true"'
# (出力なし)

;;
esac

push=false
if [[ "${{ github.event_name }}" = "push" ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

シェルスクリプトの中では${{ github.XXX }}より${GITHUB_XXX}を使って欲しい。評価タイミングが揃うから。

esac
fi
else
version=${{ matrix.id }}-latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

タグじゃない"${GITHUB_EVENT_NAME}" = "push"のときはpush=trueして欲しい。

Comment on lines 33 to 35
if [ "${GITHUB_EVENT_NAME}" = "push" ] && [ "${GITHUB_REF_TYPE}" != "tag" ]; then
push=true
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これだとmysql-8.0.30-12.06とかのイメージがpushされなくない?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

タシカニ…。脳みそがおつかれなので、復活してから整理します…。

esac
if [ "${GITHUB_EVENT_NAME}" = "push" ]; then
push=true
if [ "${GITHUB_REF_TYPE}" = "tag" ] && [[ !("${GITHUB_REF_NAME}" =~ ^${{ matrix.id }}\.) ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bashで正規表現を何回も使うのはしんどいのでこんなんでいけないかな。

Suggested change
if [ "${GITHUB_REF_TYPE}" = "tag" ] && [[ !("${GITHUB_REF_NAME}" =~ ^${{ matrix.id }}\.) ]]; then
if [ "${GITHUB_REF_TYPE}" = "tag" ] && [ "${version}" != "${GITHUB_REF_NAME}” ]; then

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

タシカニ。$version を見る発想はあったんですが、-latest の有無で判断すべきという思考から抜け出せなかったです…。

@kou kou merged commit d3e2924 into mroonga:master Nov 13, 2024
1 check failed
@abetomo abetomo deleted the drop-support-for-mysql57 branch November 13, 2024 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants