Skip to content

Release 0.10.1

Release 0.10.1 #11

Workflow file for this run

name: release
run-name: Release ${{ github.ref_name }}
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*" # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
permissions:
packages: write
contents: write
jobs:
publish-docker:
uses: ./.github/workflows/publish-docker.yml
sdk-java:
runs-on: ubuntu-latest
needs:
- publish-docker
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "corretto"
java-version: "11"
- name: Tests
run: ./gradlew sdk-java:test
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Generate KeyRing
run: |
gpg --keyring secring.gpg --export-secret-keys --passphrase ${{ secrets.GPG_PASSPHRASE }} --batch --yes --pinentry-mode=loopback > ~/.gnupg/secring.gpg
ls ~/.gnupg/
- name: Publish
run: |
./gradlew sdk-java:publish -Psigning.secretKeyRingFile=/home/runner/.gnupg/secring.gpg -Psigning.password=${{ secrets.GPG_PASSPHRASE }} -Psigning.keyId=${{ vars.GPG_KEY_ID }} -PossrhUsername=${{ secrets.OSSRH_USERNAME }} -PossrhPassword=${{ secrets.OSSRH_PASSWORD }}
echo Login at https://s01.oss.sonatype.org/
sdk-python:
runs-on: ubuntu-latest
needs:
- publish-docker
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install poetry
- name: Tests
working-directory: ./sdk-python
run: |
poetry install
poetry run python -m unittest -v
poetry build
- name: Publish Package
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: ./sdk-python/dist/
sdk-js:
runs-on: ubuntu-latest
needs:
- publish-docker
env:
working-directory: ./sdk-js
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
cache-dependency-path: ${{env.working-directory}}
- name: Install dependencies
working-directory: ${{env.working-directory}}
run: npm ci
- name: Run unit tests
working-directory: ${{env.working-directory}}
run: npm test
- name: Use tag
working-directory: ${{env.working-directory}}
env:
TAG: ${{ github.ref_name }}
run: cat package.json | jq -r ".version = \"${TAG}\"" | tee package.json
- name: Build
working-directory: ${{env.working-directory}}
run: npm run build
- name: Publish
working-directory: ${{env.working-directory}}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: npm publish --access public
lhctl:
strategy:
fail-fast: true
matrix:
build:
- linux x64
- macos aarch64
- windows x64
include:
- build: linux x64
os: ubuntu-latest
target: linux-amd64
- build: macos aarch64
os: macos-latest
target: darwin-aarch64
- build: windows x64
os: windows-latest
target: windows-amd64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
- name: Build
if: matrix.target == 'windows-amd64'
run: go build -o build/lhctl.exe ./lhctl
- name: Build
if: matrix.target != 'windows-amd64'
run: go build -o build/lhctl ./lhctl
- name: Zip build
if: matrix.target == 'windows-amd64'
run: Compress-Archive -Path build/lhctl.exe -Destination build/lhctl-${{matrix.target}}.zip
- name: Tar build
if: matrix.target != 'windows-amd64'
run: tar -czvf build/lhctl-${{matrix.target}}.tar.gz -C build lhctl
- name: Upload release archive
uses: actions/upload-artifact@v4
with:
name: lhctl-${{matrix.target}}
path: build/lhctl-${{matrix.target}}.*
create-release:
needs:
- lhctl
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate a changelog
uses: orhun/git-cliff-action@v3
id: git-cliff
with:
config: cliff.toml
args: --verbose --current
env:
OUTPUT: CHANGELOG.md
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: build
merge-multiple: true
- name: Create Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
gh release create ${{ github.ref_name }} -t ${{ github.ref_name }} -F CHANGELOG.md build/lhctl-*