Skip to content

Commit

Permalink
Optimize release step of github workflow to reuse build artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenWeathers committed Jul 14, 2023
1 parent 1a6087c commit 1be39e2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ jobs:
- name: Generate swagger docs
run: swag init -g http/http.go -o swaggerdocs

# - name: Test
# run: go test `go list ./... | grep -v swaggerdocs`

- name: Build
run: go build -v .

# - name: golangci-lint
# uses: golangci/golangci-lint-action@v3
# with:
# version: v1.29
- name: Archive build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
dist
swaggerdocs
- name: Run Thunderdome application
run: ./thunderdome-planning-poker &
Expand All @@ -94,7 +94,7 @@ jobs:
env:
DB_HOST: ${{ matrix.db-host }}

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,10 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- run: go install github.com/swaggo/swag/cmd/swag@v1.8.3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci --no-optional
- run: npm run build --if-present
env:
CI: true
name: build-artifacts
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
Expand All @@ -74,4 +69,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Clear
if: always()
run: rm -f ${ HOME }/.docker/config.json
run: rm -f ${HOME}/.docker/config.json
2 changes: 0 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ before:
- go mod download
# you may remove this if you don't need go generate
- go generate ./...
# Build dependencies
- make build-deps
builds:
- env: [ CGO_ENABLED=0 ]
goos:
Expand Down

0 comments on commit 1be39e2

Please sign in to comment.