try limit 10 for debugging #70
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
# yamllint disable rule:line-length | |
--- | |
name: package | |
# yamllint disable-line rule:truthy | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
package: | |
strategy: | |
matrix: | |
build-os: [ubuntu-latest, macOS-latest] | |
platform: [linux-amd64, windows-amd64, darwin-amd64, darwin-arm64] | |
runs-on: ${{ matrix.build-os }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.22.3 | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install linux dependencies | |
if: ${{ matrix.build-os == 'ubuntu-latest' }} | |
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config gcc-mingw-w64 zip | |
- name: Build packages windows-amd64 | |
if: ${{ matrix.platform == 'windows-amd64' && matrix.build-os == 'ubuntu-latest' }} | |
run: | | |
export PATH=$PATH:$(go env GOPATH)/bin | |
echo "building for ${{ matrix.platform }}" | |
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go build -v -ldflags "-s -w -X github.com/SafetyCulture/safetyculture-exporter/internal/app/version.version=${{ github.ref_name }}" -o safetyculture-exporter.exe ./cmd/safetyculture-exporter/main.go | |
mkdir safetyculture-exporter-cli | |
cp safetyculture-exporter.exe README.md THIRD_PARTY_NOTICES.md safetyculture-exporter-cli/ | |
zip -r safetyculture-exporter-windows-x86_64.zip safetyculture-exporter-cli | |
rm -rf safetyculture-exporter-cli | |
- name: Upload artifacts windows-amd64 | |
if: ${{ matrix.platform == 'windows-amd64' && matrix.build-os == 'ubuntu-latest' }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: exporter-windows-amd64 | |
path: safetyculture-exporter-windows-x86_64.zip | |
- name: Build package linux-amd64 | |
if: ${{ matrix.platform == 'linux-amd64' && matrix.build-os == 'ubuntu-latest' }} | |
run: | | |
export PATH=$PATH:$(go env GOPATH)/bin | |
echo "building for ${{ matrix.platform }}" | |
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -v -ldflags "-s -w -X github.com/SafetyCulture/safetyculture-exporter/internal/app/version.version=${{ github.ref_name }}" -o safetyculture-exporter ./cmd/safetyculture-exporter/main.go | |
zip safetyculture-exporter_linux_x86_64.zip exporter-linux README.md THIRD_PARTY_NOTICES.md | |
mkdir safetyculture-exporter-cli | |
cp safetyculture-exporter README.md THIRD_PARTY_NOTICES.md safetyculture-exporter-cli/ | |
zip -r safetyculture-exporter-linux-amd64.zip safetyculture-exporter-cli | |
rm -rf safetyculture-exporter-cli | |
- name: Upload artifacts linux-amd64 | |
if: ${{ matrix.platform == 'linux-amd64' && matrix.build-os == 'ubuntu-latest' }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: exporter-linux-amd64 | |
path: safetyculture-exporter-linux-amd64.zip | |
- name: Build package darwin-amd64 | |
if: ${{ matrix.platform == 'darwin-amd64' && matrix.build-os == 'macOS-latest' }} | |
env: | |
MAC_SIGNING_CERT: ${{ secrets.MAC_SIGNING_CERT }} | |
run: | | |
echo "Importing certificates" | |
echo $MAC_SIGNING_CERT | base64 --decode > certificate.p12 | |
security create-keychain -p ${{ secrets.MAC_SIGNING_KEYCHAIN_PWD }} build.keychain | |
security default-keychain -s build.keychain | |
security unlock-keychain -p ${{ secrets.MAC_SIGNING_KEYCHAIN_PWD }} build.keychain | |
security import certificate.p12 -k build.keychain -P ${{ secrets.MAC_SIGNING_CERT_PASSWORD }} -T /usr/bin/codesign | |
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k ${{ secrets.MAC_SIGNING_KEYCHAIN_PWD }} build.keychain | |
export PATH=$PATH:$(go env GOPATH)/bin | |
echo "building for ${{ matrix.platform }}" | |
GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 go build -v -ldflags "-s -w -X github.com/SafetyCulture/safetyculture-exporter/internal/app/version.version=${{ github.ref_name }}" -o safetyculture-exporter ./cmd/safetyculture-exporter/main.go | |
echo "Code signing darwin/amd64" | |
codesign --force -s "${{ secrets.MAC_SIGNING_CERT_NAME }}" --options runtime ./safetyculture-exporter -v | |
mkdir safetyculture-exporter-cli | |
cp safetyculture-exporter README.md THIRD_PARTY_NOTICES.md safetyculture-exporter-cli/ | |
zip -r safetyculture-exporter-darwin-amd64.zip safetyculture-exporter-cli | |
rm -rf safetyculture-exporter-cli | |
- name: Upload artifacts darwin-amd64 | |
if: ${{ matrix.platform == 'darwin-amd64' && matrix.build-os == 'macOS-latest' }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: exporter-darwin-amd64 | |
path: safetyculture-exporter-darwin-amd64.zip | |
- name: Build package darwin-arm64 | |
if: ${{ matrix.platform == 'darwin-arm64' && matrix.build-os == 'macOS-latest' }} | |
env: | |
MAC_SIGNING_CERT: ${{ secrets.MAC_SIGNING_CERT }} | |
run: | | |
echo "Importing certificates" | |
echo $MAC_SIGNING_CERT | base64 --decode > certificate.p12 | |
security create-keychain -p ${{ secrets.MAC_SIGNING_KEYCHAIN_PWD }} build.keychain | |
security default-keychain -s build.keychain | |
security unlock-keychain -p ${{ secrets.MAC_SIGNING_KEYCHAIN_PWD }} build.keychain | |
security import certificate.p12 -k build.keychain -P ${{ secrets.MAC_SIGNING_CERT_PASSWORD }} -T /usr/bin/codesign | |
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k ${{ secrets.MAC_SIGNING_KEYCHAIN_PWD }} build.keychain | |
export PATH=$PATH:$(go env GOPATH)/bin | |
echo "building for ${{ matrix.platform }}" | |
GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 go build -v -ldflags "-s -w -X github.com/SafetyCulture/safetyculture-exporter/internal/app/version.version=${{ github.ref_name }}" -o safetyculture-exporter ./cmd/safetyculture-exporter/main.go | |
echo "Code signing darwin/arm64" | |
codesign --force -s "${{ secrets.MAC_SIGNING_CERT_NAME }}" --options runtime ./safetyculture-exporter -v | |
mkdir safetyculture-exporter-cli | |
cp safetyculture-exporter README.md THIRD_PARTY_NOTICES.md safetyculture-exporter-cli/ | |
zip -r safetyculture-exporter-darwin-arm64.zip safetyculture-exporter-cli | |
rm -rf safetyculture-exporter-cli | |
- name: Upload artifacts darwin-arm64 | |
if: ${{ matrix.platform == 'darwin-arm64' && matrix.build-os == 'macOS-latest' }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: exporter-darwin-arm64 | |
path: safetyculture-exporter-darwin-arm64.zip | |
release: | |
runs-on: ubuntu-latest | |
needs: package | |
steps: | |
- name: Download package windows amd64 | |
uses: actions/download-artifact@v2 | |
with: | |
name: exporter-windows-amd64 | |
- name: Download package darwin amd64 | |
uses: actions/download-artifact@v2 | |
with: | |
name: exporter-darwin-amd64 | |
- name: Download package darwin arm64 | |
uses: actions/download-artifact@v2 | |
with: | |
name: exporter-darwin-arm64 | |
- name: Download package linux amd64 | |
uses: actions/download-artifact@v2 | |
with: | |
name: exporter-linux-amd64 | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
artifacts: "safetyculture-exporter-windows-x86_64.zip,safetyculture-exporter-darwin-arm64.zip,safetyculture-exporter-darwin-amd64.zip,safetyculture-exporter-linux-amd64.zip" | |
allowUpdates: true | |
prerelease: true | |
draft: true | |
makeLatest: false |