-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
221 additions
and
151 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: [ v*, print2pdf/v* ] | ||
|
||
jobs: | ||
release-package: | ||
name: Release GO package | ||
if: ${{ startsWith(github.ref_name, 'print2pdf/v') }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache-dependency-path: print2pdf/go.sum | ||
go-version-file: print2pdf/go.mod | ||
|
||
- name: Publish package | ||
env: | ||
GOPROXY: proxy.golang.org | ||
TAG: ${{ github.ref_name }} | ||
run: go list -m "github.com/chialab/print2pdf-go/print2pdf@${TAG#print2pdf/}" | ||
|
||
release-binaries: | ||
name: Build and release binaries | ||
if: ${{ startsWith(github.ref_name, 'v') }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
timeout-minutes: 5 | ||
strategy: | ||
matrix: | ||
module: ['plain', 'lambda'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache-dependency-path: ${{ matrix.module }}/go.sum | ||
go-version-file: ${{ matrix.module }}/go.mod | ||
|
||
- name: Build | ||
env: | ||
CGO_ENABLED: 0 | ||
run: | | ||
GOOS=linux GOARCH=amd64 go build -C ${{ matrix.module }} -ldflags '-s' -o ../build/print2pdf-${{ matrix.module }}-linux-amd64 | ||
GOOS=linux GOARCH=arm64 go build -C ${{ matrix.module }} -ldflags '-s' -o ../build/print2pdf-${{ matrix.module }}-linux-arm64 | ||
GOOS=darwin GOARCH=amd64 go build -C ${{ matrix.module }} -ldflags '-s' -o ../build/print2pdf-${{ matrix.module }}-darwin-amd64 | ||
GOOS=darwin GOARCH=arm64 go build -C ${{ matrix.module }} -ldflags '-s' -o ../build/print2pdf-${{ matrix.module }}-darwin-arm64 | ||
GOOS=windows GOARCH=amd64 go build -C ${{ matrix.module }} -ldflags '-s' -o ../build/print2pdf-${{ matrix.module }}-windows-amd64 | ||
GOOS=windows GOARCH=arm64 go build -C ${{ matrix.module }} -ldflags '-s' -o ../build/print2pdf-${{ matrix.module }}-windows-arm64 | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
draft: true | ||
generate_release_notes: true | ||
files: | | ||
build/print2pdf-${{ matrix.module }}-linux-amd64 | ||
build/print2pdf-${{ matrix.module }}-linux-arm64 | ||
build/print2pdf-${{ matrix.module }}-darwin-amd64 | ||
build/print2pdf-${{ matrix.module }}-darwin-arm64 | ||
build/print2pdf-${{ matrix.module }}-windows-amd64 | ||
build/print2pdf-${{ matrix.module }}-windows-arm64 | ||
release-containers: | ||
name: Build and release containers | ||
if: ${{ startsWith(github.ref_name, 'v') }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
timeout-minutes: 5 | ||
strategy: | ||
matrix: | ||
module: ['plain', 'lambda'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
ghcr.io/chialab/print2pdf | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
flavor: | | ||
suffix=-${{ matrix.module }} | ||
latest=false | ||
- name: Login to GitHub Packages | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ${{ matrix.module }} | ||
file: ${{ matrix.module }}/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
Oops, something went wrong.