Docker release workflow changes #91
Workflow file for this run
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: Release | |
on: | |
pull_request: | |
branches: ['main'] | |
paths: | |
- .github/workflows/release.yml | |
- .goreleaser.yaml | |
push: | |
tags: ['v*.*.*'] | |
jobs: | |
docker: | |
if: ${{ github.event_name != 'pull_request' }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
tool: | |
- ux | |
- uml2ts | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/build-docker | |
with: | |
file: docker/${{ matrix.tool }}/Dockerfile | |
images: ghcr.io/${{ github.repository_owner }}/${{ matrix.tool }} | |
push: ${{ github.event_name != 'pull_request' }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
bun: | |
name: Compile Bun apps | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
tool: | |
- uml2ts | |
target: | |
- bun-linux-x64 | |
- bun-linux-arm64 | |
- bun-darwin-x64 | |
- bun-darwin-arm64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version-file: package.json | |
- name: Restore dependencies | |
working-directory: packages/${{ matrix.tool }} | |
run: bun install --frozen-lockfile | |
- name: Build | |
run: | | |
bun build \ | |
--compile \ | |
--target ${{ matrix.target }} \ | |
--minify \ | |
--sourcemap ./packages/${{ matrix.tool }}/index.ts \ | |
--outfile ${{ matrix.tool }} | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.tool }}_${{ matrix.target }} | |
path: ${{ matrix.tool }} | |
goreleaser: | |
name: Run GoReleaser | |
runs-on: ubuntu-latest | |
needs: bun | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: '*' | |
path: ${{ github.workspace }}/bin | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
cache-dependency-path: go.sum | |
- name: GoReleaser Dry-run | |
if: github.event_name == 'pull_request' | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
version: '~> v2' | |
args: release --snapshot | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Disable the monorepo feature | |
GORELEASER_CURRENT_TAG: v0.0.1 | |
GORELEASER_PREVIOUS_TAG: v0.0.1-alpha | |
- name: Run GoReleaser | |
if: github.event_name != 'pull_request' | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
version: '~> v2' | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |