Skip to content

v0.0.28

v0.0.28 #50

Workflow file for this run

name: Release
on:
release:
types: [created]
env:
KO_DOCKER_REPO: index.docker.io/blipai
GO_VERSION: 1.18
DOTNET_VERSION: 6.0.x
jobs:
release-deckard-executable:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
- name: Build Linux AMD64
env:
GOOS: linux
GOARCH: amd64
run: go build -o exec/deckard-linux-amd64 internal/cmd/deckard/main.go
- name: Build Windows AMD64
env:
GOOS: windows
GOARCH: amd64
run: go build -o exec/deckard-windows-amd64.exe internal/cmd/deckard/main.go
- name: Install zip and tar
run: |
sudo apt-get install -y zip tar
- name: Compress files
run: |
# Compress the Windows executable to zip
zip -r -j deckard-windows-amd64.exe.zip exec/deckard-windows-amd64.exe
# Compress the Linux executable to tar.gz
tar -czvf deckard-linux-amd64.tar.gz -C exec deckard-linux-amd64
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: |
deckard-windows-amd64.exe.zip
deckard-linux-amd64.tar.gz
release-deckard-image:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/checkout@v3
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
- name: Setup Ko
uses: ko-build/setup-ko@v0.6
- name: Publish image
env:
auth_token: ${{ secrets.DOCKER_HUB_TOKEN }}
run: |
echo "${auth_token}" | ko login index.docker.io --username lucasoares3 --password-stdin
make build-image
release-java-package:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Copy .proto
run: mkdir -p java/src/main/proto && cp -r proto java/src/main/proto
- name: Publish package
working-directory: java
run: mvn clean deploy jreleaser:deploy -Ppublication
env:
JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-csharp-package:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Install dependencies
working-directory: csharp
run: dotnet restore
- name: Copy .proto
run: mkdir -p csharp/proto && cp -r proto csharp/
- name: Build sources
working-directory: csharp
run: dotnet build --configuration Release
- name: Pack NuGet package
working-directory: csharp
run: dotnet pack --no-build --configuration Release
- name: Publish package
working-directory: csharp
run: find bin/Release/ -name '*.nupkg' | xargs -i dotnet nuget push {} --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_ORG_API_KEY: ${{ secrets.NUGET_ORG_API_KEY }}