mysqldef: Fixed an issue where removing table comments caused an erro… #1618
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: sqldef | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
target: | |
- sqlite3def | |
- mssqldef | |
include: | |
- target: mysqldef | |
mysql_version: '5.7' | |
- target: mysqldef | |
mysql_version: '8.0' | |
- target: psqldef | |
postgres_version: 10 | |
- target: psqldef | |
postgres_version: 11 | |
- target: psqldef | |
postgres_version: 12 | |
- target: psqldef | |
postgres_version: 13 | |
- target: psqldef | |
postgres_version: 14 | |
- target: psqldef | |
postgres_version: 15 | |
fail-fast: false | |
steps: | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- uses: actions/checkout@v4 | |
- run: docker compose up -d | |
env: | |
MYSQL_VERSION: ${{ matrix.mysql_version }} | |
POSTGRES_VERSION: ${{ matrix.postgres_version }} | |
- run: make deps | |
- run: make test-${{ matrix.target }} | |
package: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { GOOS: linux, GOARCH: amd64, EXT: tar.gz } | |
- { GOOS: linux, GOARCH: '386', EXT: tar.gz } | |
- { GOOS: linux, GOARCH: arm64, EXT: tar.gz } | |
- { GOOS: linux, GOARCH: arm, EXT: tar.gz } | |
- { GOOS: windows, GOARCH: amd64, EXT: zip } | |
steps: | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- uses: actions/checkout@v4 | |
- name: make package-${{ matrix.EXT }} | |
run: | | |
make package-${{ matrix.EXT }} GOOS=${{ matrix.GOOS }} GOARCH=${{ matrix.GOARCH }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sqldef-${{ matrix.GOOS }}-${{ matrix.GOARCH }} | |
path: package/*def_${{ matrix.GOOS }}_${{ matrix.GOARCH }}.${{ matrix.EXT }} | |
package-macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
include: | |
- { GOOS: darwin, GOARCH: amd64, EXT: zip } | |
- { GOOS: darwin, GOARCH: arm64, EXT: zip } | |
fail-fast: false | |
steps: | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- uses: actions/checkout@v4 | |
- name: make package-${{ matrix.EXT }} | |
run: make package-${{ matrix.EXT }} GOOS=${{ matrix.GOOS }} GOARCH=${{ matrix.GOARCH }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sqldef-${{ matrix.GOOS }}-${{ matrix.GOARCH }} | |
path: package/*def_${{ matrix.GOOS }}_${{ matrix.GOARCH }}.${{ matrix.EXT }} | |
release: | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
- package | |
- package-macos | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
- { uses: actions/download-artifact@v4, with: { name: sqldef-linux-amd64, path: package/ } } | |
- { uses: actions/download-artifact@v4, with: { name: sqldef-linux-386, path: package/ } } | |
- { uses: actions/download-artifact@v4, with: { name: sqldef-linux-arm64, path: package/ } } | |
- { uses: actions/download-artifact@v4, with: { name: sqldef-linux-arm, path: package/ } } | |
- { uses: actions/download-artifact@v4, with: { name: sqldef-darwin-amd64, path: package/ } } | |
- { uses: actions/download-artifact@v4, with: { name: sqldef-darwin-arm64, path: package/ } } | |
- { uses: actions/download-artifact@v4, with: { name: sqldef-windows-amd64, path: package/ } } | |
- name: Release binaries | |
run: | | |
export VERSION=$(echo "$GITHUB_REF" | sed -e 's!refs/tags/!!') | |
curl -L "https://github.com/tcnksm/ghr/releases/download/${GHR_VERSION}/ghr_${GHR_VERSION}_linux_amd64.tar.gz" | tar xvz | |
"ghr_${GHR_VERSION}_linux_amd64/ghr" -u sqldef -r sqldef -replace -n "$VERSION" "$VERSION" package/ | |
env: | |
GHR_VERSION: v0.13.0 | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
with: | |
repository: sqldef/homebrew-sqldef | |
ssh-key: ${{ secrets.HOMEBREW_DEPLOY_KEY }} | |
path: ./homebrew-sqldef | |
- name: Update homebrew | |
run: | | |
set -x | |
cd ./homebrew-sqldef | |
VERSION=$(echo "$GITHUB_REF" | sed -e 's!refs/tags/!!') | |
sed -i -e "s/tag: '.*'/tag: '$VERSION'/" mysqldef.rb psqldef.rb mssqldef.rb sqlite3def.rb | |
git add . | |
if ! git diff-index --quiet HEAD --; then | |
git config --global user.email "[email protected]" | |
git config --global user.name "sqldef" | |
git commit -m "Version $VERSION" | |
git push origin master | |
fi |