Skip to content

Deneb Support (#104) #9

Deneb Support (#104)

Deneb Support (#104) #9

name: Build/release
on:
push:
tags:
- v*
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
release:
runs-on: ${{ matrix.os }}
# runs-on: [self-hosted]
strategy:
matrix:
os: [ macos-latest, ubuntu-latest ]
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version-file: 'go.mod'
- name: Checkout code
uses: actions/checkout@v2
#
# - name: List files in the repository
# run: |
# ls ${{ github.workspace }}
# START macOs and windows steps
- name: Create Cli For Mac
if: ${{ startsWith(matrix.os, 'macos-latest') && startsWith(github.ref, 'refs/tags/v') }}
run: go build -o keyvault-cli ./cli
- name: change Permission
if: ${{ startsWith(matrix.os, 'macos-latest') && startsWith(github.ref, 'refs/tags/v') }}
run: chmod 777 keyvault-cli
- name: Rename cli file
if: ${{ startsWith(matrix.os, 'macos-latest') && startsWith(github.ref, 'refs/tags/v') }}
run: mv keyvault-cli mac-keyvault-cli
- name: Release assets Mac
if: ${{ startsWith(matrix.os, 'macos-latest') && startsWith(github.ref, 'refs/tags/v') }}
uses: ncipollo/release-action@v1
with:
draft: true
allowUpdates: true
artifacts: "mac-keyvault-cli"
token: ${{ secrets.GITHUB_TOKEN }}
- name: install mingw-w64
if: ${{ startsWith(matrix.os, 'macos-latest') && startsWith(github.ref, 'refs/tags/v') }}
run: brew install mingw-w64
- name: Create Cli For Windows
if: ${{ startsWith(matrix.os, 'macos-latest') && startsWith(github.ref, 'refs/tags/v') }}
run: env CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ GOOS=windows GOARCH=amd64 go build -o keyvault-cli.exe ./cli
- name: Release assets Windows
if: ${{ startsWith(matrix.os, 'macos-latest') && startsWith(github.ref, 'refs/tags/v') }}
uses: ncipollo/release-action@v1
with:
draft: true
allowUpdates: true
artifacts: "keyvault-cli.exe"
token: ${{ secrets.GITHUB_TOKEN }}
# START ubuntu steps
- name: Create Cli
if: ${{ startsWith(matrix.os, 'ubuntu-latest') && startsWith(github.ref, 'refs/tags/v') }}
run: go build -o keyvault-cli ./cli
# - name: List files in the repository
# run: |
# ls ${{ github.workspace }}
- name: Rename cli file
if: ${{ startsWith(matrix.os, 'ubuntu-latest') && startsWith(github.ref, 'refs/tags/v') }}
run: mv keyvault-cli linux-keyvault-cli
# - name: List files in the repository
# run: ls ${{ github.workspace }}
- name: change Permission
if: ${{ startsWith(matrix.os, 'ubuntu-latest') && startsWith(github.ref, 'refs/tags/v') }}
run: chmod 777 ./linux-keyvault-cli
- name: Release assets Linux
if: ${{ startsWith(matrix.os, 'ubuntu-latest') && startsWith(github.ref, 'refs/tags/v') }}
uses: ncipollo/release-action@v1
with:
draft: true
allowUpdates: true
artifacts: "linux-keyvault-cli"
token: ${{ secrets.GITHUB_TOKEN }}