-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
117 changed files
with
4,426 additions
and
1,430 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{{ range .Versions }} | ||
<a name="{{ .Tag.Name }}"></a> | ||
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} | ||
|
||
> {{ datetime "2006-01-02" .Tag.Date }} | ||
{{ range .CommitGroups -}} | ||
### {{ .Title }} | ||
|
||
{{ range .Commits -}} | ||
* {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} | ||
{{ end }} | ||
{{ end -}} | ||
|
||
{{- if .RevertCommits -}} | ||
### Reverts | ||
|
||
{{ range .RevertCommits -}} | ||
* {{ .Revert.Header }} | ||
{{ end }} | ||
{{ end -}} | ||
|
||
{{- if .MergeCommits -}} | ||
### Pull Requests | ||
|
||
{{ range .MergeCommits -}} | ||
* {{ .Header }} | ||
{{ end }} | ||
{{ end -}} | ||
|
||
{{- if .NoteGroups -}} | ||
{{ range .NoteGroups -}} | ||
### {{ .Title }} | ||
|
||
{{ range .Notes }} | ||
{{ .Body }} | ||
{{ end }} | ||
{{ end -}} | ||
{{ end -}} | ||
{{ end -}} |
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,28 @@ | ||
style: github | ||
template: CHANGELOG.tpl.md | ||
info: | ||
title: CHANGELOG | ||
repository_url: https://github.com/goreleaser/goreleaser-cross | ||
options: | ||
commits: | ||
# filters: | ||
# Type: | ||
# - feat | ||
# - fix | ||
# - perf | ||
# - refactor | ||
commit_groups: | ||
title_maps: | ||
feat: Features | ||
fix: Bug Fixes | ||
perf: Performance Improvements | ||
refactor: Code Refactoring | ||
header: | ||
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$" | ||
pattern_maps: | ||
- Type | ||
- Scope | ||
- Subject | ||
notes: | ||
keywords: | ||
- BREAKING CHANGE |
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,11 @@ | ||
GO_VERSION=1.19.1 | ||
GIT_CHGLOG_VERSION=v0.15.0 | ||
GORELEASER_VERSION=1.11.2 | ||
OSX_SDK=MacOSX12.0.sdk | ||
OSX_SDK_SUM=ac07f28c09e6a3b09a1c01f1535ee71abe8017beaedd09181c8f08936a510ffd | ||
OSX_VERSION_MIN=10.9 | ||
OSX_CROSS_COMMIT=e59a63461da2cbc20cb0a5bbfc954730e50a5472 | ||
DEBIAN_FRONTEND=noninteractive | ||
TINI_VERSION=v0.19.0 | ||
COSIGN_VERSION=1.11.1 | ||
COSIGN_SHA256=f9fd5a287a67f4b955d08062a966df10f9a600b6b8583fd367bce3f1f000a429 |
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,99 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
env: | ||
GO111MODULE: on | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- run: git fetch --prune --unshallow | ||
- name: Setup env | ||
uses: c-py/action-dotenv-to-setenv@v3 | ||
with: | ||
env-file: .env | ||
- name: Define and set tags | ||
shell: bash | ||
id: meta | ||
run: | | ||
export cross_tags="$(./scripts/image-tags.sh cross)" | ||
export cross_base_tags="$(./scripts/image-tags.sh cross-base)" | ||
cross_tags="${cross_tags//'%'/'%25'}" | ||
cross_tags="${cross_tags//$'\n'/'%0A'}" | ||
cross_tags="${cross_tags//$'\r'/'%0D'}" | ||
cross_base_tags="${cross_base_tags//'%'/'%25'}" | ||
cross_base_tags="${cross_base_tags//$'\n'/'%0A'}" | ||
cross_base_tags="${cross_base_tags//$'\r'/'%0D'}" | ||
echo "::set-output name=cross_tags::$cross_tags" | ||
echo "::set-output name=cross_base_tags::$cross_base_tags" | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Install cosign | ||
uses: sigstore/cosign-installer@v2.5.0 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: "${{ env.GO_VERSION }}" | ||
- name: Install git-chglog | ||
run: go install github.com/git-chglog/git-chglog/cmd/git-chglog@${{ env.GIT_CHGLOG_VERSION }} | ||
- name: Build and push base images | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
file: Dockerfile.base | ||
tags: ${{ steps.meta.outputs.cross_base_tags }} | ||
build-args: | | ||
"GO_VERSION=${{env.GO_VERSION}}" | ||
"GORELEASER_VERSION=${{env.GORELEASER_VERSION}}" | ||
"TINI_VERSION=${{env.TINI_VERSION}}" | ||
"COSIGN_VERSION=${{env.COSIGN_VERSION}}" | ||
"COSIGN_SHA256=${{env.COSIGN_SHA256}}" | ||
"DEBIAN_FRONTEND=${{env.DEBIAN_FRONTEND}}" | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.cross_tags }} | ||
build-args: | | ||
"GO_VERSION=${{env.GO_VERSION}}" | ||
"OSX_SDK=${{env.OSX_SDK}}" | ||
"OSX_SDK_SUM=${{env.OSX_SDK_SUM}}" | ||
"OSX_VERSION_MIN=${{env.OSX_VERSION_MIN}}" | ||
"OSX_CROSS_COMMIT=${{env.OSX_CROSS_COMMIT}}" | ||
"DEBIAN_FRONTEND=${{env.DEBIAN_FRONTEND}}" | ||
# - name: Sign images | ||
# run: | | ||
# echo "${COSIGN_KEY}" | base64 -d > /tmp/cosign.key | ||
# cosign sign --key /tmp/cosign.key ghcr.io/goreleaser/goreleaser-cross:${{env.RELEASE_TAG}} | ||
# env: | ||
# COSIGN_KEY: ${{secrets.COSIGN_PRIVATE_KEY}} | ||
# COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}} | ||
- name: Generate changelog | ||
run: make gen-changelog | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body_path: changelog.md |
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,7 @@ | ||
.idea | ||
dist | ||
vendor | ||
.docker-creds | ||
changelog.md | ||
cosign.key | ||
.tmpenv |
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,115 @@ | ||
# golang parameters | ||
ARG GO_VERSION | ||
|
||
FROM ghcr.io/goreleaser/goreleaser-cross-base:v${GO_VERSION} AS osx-cross-base | ||
ENV OSX_CROSS_PATH=/osxcross | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install deps | ||
SHELL ["/bin/bash", "-c"] | ||
RUN \ | ||
set -x; \ | ||
echo "Starting image build for Debian" \ | ||
&& dpkgArch="$(dpkg --print-architecture)" \ | ||
&& dpkg --add-architecture amd64 \ | ||
&& dpkg --add-architecture arm64 \ | ||
&& dpkg --add-architecture armel \ | ||
&& dpkg --add-architecture armhf \ | ||
&& dpkg --add-architecture i386 \ | ||
&& dpkg --add-architecture mips \ | ||
&& dpkg --add-architecture mipsel \ | ||
&& dpkg --add-architecture powerpc \ | ||
&& dpkg --add-architecture ppc64el \ | ||
&& apt-get update \ | ||
&& apt-get install --no-install-recommends -y -q \ | ||
autoconf \ | ||
automake \ | ||
bc \ | ||
python \ | ||
binfmt-support \ | ||
binutils-multiarch \ | ||
build-essential \ | ||
clang \ | ||
gcc \ | ||
g++ \ | ||
gdb \ | ||
mingw-w64 \ | ||
crossbuild-essential-amd64 \ | ||
crossbuild-essential-arm64 \ | ||
crossbuild-essential-armel \ | ||
crossbuild-essential-armhf \ | ||
crossbuild-essential-mipsel \ | ||
crossbuild-essential-ppc64el \ | ||
devscripts \ | ||
libtool \ | ||
llvm \ | ||
multistrap \ | ||
patch \ | ||
mercurial \ | ||
musl-tools \ | ||
&& apt -y autoremove \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
/tmp/* \ | ||
/var/tmp/* \ | ||
rm -rf /usr/share/man/* \ | ||
/usr/share/doc | ||
|
||
# install a copy of mingw with aarch64 support to enable windows on arm64 | ||
WORKDIR /llvm-mingw | ||
ARG TARGETARCH | ||
RUN \ | ||
if [ ${TARGETARCH} = "arm64" ]; then MINGW_ARCH=aarch64; else MINGW_ARCH=x86_64; fi && \ | ||
wget "https://github.com/mstorsjo/llvm-mingw/releases/download/20220906/llvm-mingw-20220906-ucrt-ubuntu-18.04-${MINGW_ARCH}.tar.xz" && \ | ||
tar -xvf llvm-mingw-20220906-ucrt-ubuntu-18.04-${MINGW_ARCH}.tar.xz && \ | ||
ln -s llvm-mingw-20220906-ucrt-ubuntu-18.04-${MINGW_ARCH} llvm-mingw | ||
|
||
FROM osx-cross-base AS osx-cross | ||
ARG OSX_CROSS_COMMIT | ||
ARG OSX_SDK | ||
ARG OSX_SDK_SUM | ||
ARG OSX_VERSION_MIN | ||
|
||
WORKDIR "${OSX_CROSS_PATH}" | ||
|
||
COPY patches /patches | ||
|
||
RUN \ | ||
git clone https://github.com/tpoechtrager/osxcross.git . \ | ||
&& git config user.name "John Doe" \ | ||
&& git config user.email johndoe@example.com \ | ||
&& git checkout -q "${OSX_CROSS_COMMIT}" \ | ||
&& git am < /patches/libcxx.patch \ | ||
&& rm -rf ./.git | ||
|
||
# install osxcross: | ||
COPY tars/${OSX_SDK}.tar.xz "${OSX_CROSS_PATH}/tarballs/${OSX_SDK}.tar.xz" | ||
|
||
RUN \ | ||
echo "${OSX_SDK_SUM}" "${OSX_CROSS_PATH}/tarballs/${OSX_SDK}.tar.xz" | sha256sum -c - \ | ||
&& apt-get update \ | ||
&& apt-get install --no-install-recommends -y -q \ | ||
autotools-dev \ | ||
libxml2-dev \ | ||
lzma-dev \ | ||
libssl-dev \ | ||
zlib1g-dev \ | ||
libmpc-dev \ | ||
libmpfr-dev \ | ||
libgmp-dev \ | ||
llvm-dev \ | ||
uuid-dev \ | ||
binutils-multiarch-dev \ | ||
&& apt -y autoremove \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ | ||
&& UNATTENDED=1 OSX_VERSION_MIN=${OSX_VERSION_MIN} ./build.sh | ||
|
||
FROM osx-cross-base AS final | ||
LABEL maintainer="Artur Troian <troian dot ap at gmail dot com>" | ||
LABEL "org.opencontainers.image.source"="https://github.com/goreleaser/goreleaser-cross" | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
COPY --from=osx-cross "${OSX_CROSS_PATH}/target" "${OSX_CROSS_PATH}/target" | ||
ENV PATH=${OSX_CROSS_PATH}/target/bin:$PATH |
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,56 @@ | ||
# golang parameters | ||
ARG GO_VERSION | ||
|
||
FROM golang:${GO_VERSION}-bullseye | ||
LABEL maintainer="Artur Troian <troian dot ap at gmail dot com>" | ||
LABEL "org.opencontainers.image.source"="https://github.com/goreleaser/goreleaser-cross-base" | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
ARG GORELEASER_VERSION | ||
ARG APT_MIRROR | ||
ARG TINI_VERSION | ||
ARG COSIGN_VERSION | ||
ARG COSIGN_SHA256 | ||
ARG GORELEASER_DOWNLOAD_URL=https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION} | ||
|
||
# install cosign | ||
COPY --from=gcr.io/projectsigstore/cosign:v1.11.1@sha256:f9fd5a287a67f4b955d08062a966df10f9a600b6b8583fd367bce3f1f000a429 /ko-app/cosign /usr/local/bin/cosign | ||
COPY entrypoint.sh / | ||
|
||
# Install deps | ||
RUN \ | ||
set -x \ | ||
&& dpkgArch="$(dpkg --print-architecture)" \ | ||
&& curl --fail -sSL -o /tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-$dpkgArch \ | ||
&& chmod +x /tini \ | ||
&& echo "Starting image build for Debian" \ | ||
&& sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/apt/sources.list \ | ||
&& sed -ri "s/(security).debian.org/${APT_MIRROR:-security.debian.org}/g" /etc/apt/sources.list \ | ||
&& apt-get update \ | ||
&& apt-get install --no-install-recommends -y -q \ | ||
software-properties-common \ | ||
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \ | ||
&& echo "deb [arch=$dpkgArch] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list \ | ||
&& apt-get update \ | ||
&& apt-get install --no-install-recommends -y -q \ | ||
docker-ce \ | ||
docker-ce-cli \ | ||
make \ | ||
git-core \ | ||
wget \ | ||
xz-utils \ | ||
cmake \ | ||
openssl \ | ||
&& apt -y autoremove \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ | ||
&& GORELEASER_DOWNLOAD_FILE=goreleaser_${GORELEASER_VERSION}_${dpkgArch}.deb \ | ||
&& GORELEASER_DOWNLOAD_DEB="${GORELEASER_DOWNLOAD_URL}/${GORELEASER_DOWNLOAD_FILE}" \ | ||
&& wget https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/checksums.txt.pem \ | ||
&& cosign verify-blob --cert checksums.txt.pem --signature "${GORELEASER_DOWNLOAD_URL}/checksums.txt.sig" "${GORELEASER_DOWNLOAD_URL}/checksums.txt" \ | ||
&& wget ${GORELEASER_DOWNLOAD_DEB} \ | ||
&& dpkg -i ${GORELEASER_DOWNLOAD_FILE} \ | ||
&& rm ${GORELEASER_DOWNLOAD_FILE} \ | ||
&& chmod +x /entrypoint.sh | ||
|
||
ENTRYPOINT ["/tini", "--", "/entrypoint.sh"] |
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,22 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Goren G | ||
Copyright (c) 2020 Artur Troian | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.