mirror of
https://github.com/git-chglog/git-chglog.git
synced 2026-01-22 18:06:11 +00:00
fix: release process (#231)
* chore: use --clean for goreleaser * fix(ci): add gorleaser test * fix(ci): prebuild binary in IT test * fix(ci): use only ubuntu for docker image tests
This commit is contained in:
parent
26c9a7c721
commit
6ad9b5c2db
3 changed files with 33 additions and 39 deletions
50
.github/workflows/ci.yml
vendored
50
.github/workflows/ci.yml
vendored
|
|
@ -60,31 +60,43 @@ jobs:
|
|||
with:
|
||||
version: ${{ env.GOLANGCI_VERSION }}
|
||||
|
||||
integration-tests:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
docker-image-tests:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Updating and upgrading brew
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: |
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
brew --version
|
||||
- name: Install docker-cli and start colima
|
||||
if: matrix.os == 'macos-latest'
|
||||
# https://github.com/docker/for-mac/issues/2359#issuecomment-943131345
|
||||
run: |
|
||||
brew install docker
|
||||
colima start
|
||||
docker info
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Run tests
|
||||
run: make build
|
||||
|
||||
- name: Test docker image
|
||||
run: |
|
||||
docker build -t git-chglog:ci-build .
|
||||
docker run -v ${GITHUB_WORKSPACE}:/workdir -w /workdir git-chglog:ci-build > ${GITHUB_WORKSPACE}/ci-build.md
|
||||
head ${GITHUB_WORKSPACE}/ci-build.md
|
||||
head ${GITHUB_WORKSPACE}/ci-build.md
|
||||
|
||||
goreleaser-test:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v4
|
||||
with:
|
||||
version: latest
|
||||
args: release --clean --skip-publish --snapshot
|
||||
|
|
|
|||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -34,6 +34,6 @@ jobs:
|
|||
uses: goreleaser/goreleaser-action@v4
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
args: release --clean
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}
|
||||
|
|
|
|||
20
Dockerfile
20
Dockerfile
|
|
@ -1,28 +1,10 @@
|
|||
##################
|
||||
########## Builder
|
||||
##################
|
||||
FROM golang:1.19-alpine as builder
|
||||
|
||||
RUN apk add --no-cache make git
|
||||
|
||||
WORKDIR /build
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN make build
|
||||
|
||||
##################
|
||||
########## PROD
|
||||
##################
|
||||
FROM alpine
|
||||
|
||||
RUN apk add --no-cache git && \
|
||||
mkdir /workdir && \
|
||||
git config --global --add safe.directory /workdir
|
||||
|
||||
COPY --from=builder /build/git-chglog /usr/local/bin/git-chglog
|
||||
COPY git-chglog /usr/local/bin/git-chglog
|
||||
|
||||
WORKDIR /workdir
|
||||
RUN chmod +x /usr/local/bin/git-chglog
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue