Skip to content

Add log messages to installation process #48

Add log messages to installation process

Add log messages to installation process #48

Workflow file for this run

name: Create a release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]-rc[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
name: Build the binaries
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- os: dragonfly
arch: amd64
- os: freebsd
arch: 386
- os: freebsd
arch: amd64
- os: freebsd
arch: arm
- os: freebsd
arch: arm64
- os: linux
arch: 386
- os: linux
arch: amd64
- os: linux
arch: arm
- os: linux
arch: arm64
- os: linux
arch: mips
- os: linux
arch: mips64
- os: linux
arch: mips64le
- os: linux
arch: mipsle
- os: linux
arch: ppc64
- os: linux
arch: ppc64le
- os: linux
arch: riscv64
- os: linux
arch: s390x
- os: netbsd
arch: 386
- os: netbsd
arch: amd64
- os: netbsd
arch: arm
- os: netbsd
arch: arm64
- os: openbsd
arch: 386
- os: openbsd
arch: amd64
- os: openbsd
arch: arm
- os: openbsd
arch: arm64
- os: solaris
arch: amd64
- os: windows
arch: 386
- os: windows
arch: amd64
- os: windows
arch: arm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get the version
id: get_version
run: echo "version=$(echo ${{ github.ref }} | cut -d / -f 3)" >> $GITHUB_ENV
- uses: actions/setup-go@v4
with:
go-version: '^1.16'
- name: Get go version
run: echo "go_version=$(go version)" >> $GITHUB_ENV
- name: Set binary name
if: matrix.platform.os != 'windows'
run: echo "binary_name=kpkg" >> $GITHUB_ENV
- name: Set binary name for windows
if: matrix.platform.os == 'windows'
run: echo "binary_name=kpkg.exe" >> $GITHUB_ENV
- name: Build
run: GOOS=${{ matrix.platform.os }} GOARCH=${{ matrix.platform.arch }} go build -o ${{ env.binary_name }} -ldflags="-X 'main.version=${{ env.version }}' -X 'main.commit=${{ github.sha }}' -X 'main.goVersion=${{ env.go_version }}' -X 'main.cliOs=${{ matrix.platform.os }}' -X 'main.cliArch=${{ matrix.platform.arch }}'"
- name: change binary permissions
run: chmod +x ./${{ env.binary_name }}
- name: zip binary
run: zip -r kpkg_${{ matrix.platform.os }}_${{ matrix.platform.arch }}.zip ./${{ env.binary_name }}
- name: upload zipped artifacts
uses: actions/upload-artifact@v3
with:
name: kpkg_${{ matrix.platform.os }}_${{ matrix.platform.arch }}.zip
path: kpkg_${{ matrix.platform.os }}_${{ matrix.platform.arch }}.zip
build-darwin:
runs-on: macos-latest
strategy:
matrix:
platform:
- arch: amd64
- arch: arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get the version
id: get_version
run: echo "version=$(echo ${{ github.ref }} | cut -d / -f 3)" >> $GITHUB_ENV
- uses: actions/setup-go@v4
with:
go-version: '^1.16'
- name: Get go version
run: echo "go_version=$(go version)" >> $GITHUB_ENV
- name: Build
run: GOOS=darwin GOARCH=${{ matrix.platform.arch }} go build -o kpkg -ldflags="-X 'main.version=${{ env.version }}' -X 'main.commit=${{ github.sha }}' -X 'main.goVersion=${{ env.go_version }}' -X 'main.cliOs=darwin' -X 'main.cliArch=${{ matrix.platform.arch }}'"
- name: change binary permissions
run: chmod +x ./kpkg
# - name: Import Code-Signing Certificates
# uses: Apple-Actions/import-codesign-certs@v2
# with:
# # The certificates in a PKCS12 file encoded as a base64 string
# p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
# # The password used to import the PKCS12 file.
# p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
#
# - name: Install gon via HomeBrew for code signing and app notarization
# run: |
# brew tap mitchellh/gon
# brew install mitchellh/gon/gon
#
# - name: Sign the mac binaries with Gon
# env:
# AC_USERNAME: ${{ secrets.AC_USERNAME }}
# AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
# run: gon ./gon.hcl
#
# - name: Rename zip file
# run: mv ./kpkg_darwin.zip ./kpkg_darwin_${{ matrix.platform.arch }}.zip
#
# - name: upload notorized artifacts
# uses: actions/upload-artifact@v3
# with:
# name: kpkg_darwin_${{ matrix.platform.arch }}.zip
# path: kpkg_darwin_${{ matrix.platform.arch }}.zip
- name: zip binary
run: zip -r kpkg_darwin_${{ matrix.platform.arch }}.zip ./kpkg
- name: upload zipped artifacts
uses: actions/upload-artifact@v3
with:
name: kpkg_darwin_${{ matrix.platform.arch }}.zip
path: kpkg_darwin_${{ matrix.platform.arch }}.zip
create-release:
needs: [build, build-darwin]
runs-on: ubuntu-latest
outputs:
release-url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Check if prerelease
run: |
if [[ ${{ github.ref }} == *"rc"* ]]; then
echo "prerelease=true" >> $GITHUB_ENV
else
echo "prerelease=false" >> $GITHUB_ENV
fi
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: ./build-assets
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: ${{ env.prerelease }}
files: |
./build-assets/**