2021-12-20 01:06:17 +00:00
|
|
|
name: GoReleaser Orbit
|
2021-06-26 01:40:26 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-12-20 01:06:17 +00:00
|
|
|
tags:
|
|
|
|
- 'orbit-*'
|
|
|
|
|
2021-06-26 01:40:26 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
goreleaser:
|
2021-12-20 01:06:17 +00:00
|
|
|
runs-on: macos-latest
|
2021-06-26 02:58:35 +00:00
|
|
|
environment: Docker Hub
|
2021-06-26 01:40:26 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2021-12-20 01:06:17 +00:00
|
|
|
|
|
|
|
# Note that goreleaser does not like the orbit- prefixed flag unless you use the closed-source
|
|
|
|
# paid version. We pay for goreleaser, but using the closed source build would weaken our
|
|
|
|
# supply-chain integrity goals, so we hack around it by replacing the tag.
|
|
|
|
- name: Replace tag
|
|
|
|
run: git tag $(echo ${{ github.ref_name }} | sed -e 's/orbit-//g')
|
|
|
|
|
|
|
|
- name: Import signing keys
|
|
|
|
env:
|
|
|
|
APPLE_APPLICATION_CERTIFICATE: ${{ secrets.APPLE_APPLICATION_CERTIFICATE }}
|
|
|
|
APPLE_APPLICATION_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_APPLICATION_CERTIFICATE_PASSWORD }}
|
|
|
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
|
|
run: |
|
|
|
|
echo "$APPLE_APPLICATION_CERTIFICATE" | base64 --decode > certificate.p12
|
|
|
|
security create-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
security default-keychain -s build.keychain
|
|
|
|
security unlock-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
security import certificate.p12 -k build.keychain -P $APPLE_APPLICATION_CERTIFICATE_PASSWORD -T /usr/bin/codesign
|
|
|
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
security find-identity -vv
|
2021-06-26 01:40:26 +00:00
|
|
|
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-12-20 01:06:17 +00:00
|
|
|
go-version: 1.17
|
2021-06-26 01:40:26 +00:00
|
|
|
|
|
|
|
- name: Run GoReleaser
|
2021-12-20 01:37:54 +00:00
|
|
|
run: go run github.com/goreleaser/goreleaser release --rm-dist -f orbit/.goreleaser.yml
|
2021-06-26 01:40:26 +00:00
|
|
|
env:
|
2021-12-20 01:06:17 +00:00
|
|
|
AC_USERNAME: ${{ secrets.APPLE_USERNAME }}
|
|
|
|
AC_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
|
|
|
CODESIGN_IDENTITY: 51049B247B25B3119FAE7E9C0CC4375A43E47237
|
2021-06-26 01:40:26 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|