Skip to content

harmony sdk release #58

harmony sdk release

harmony sdk release #58

name: harmony sdk release
on:
workflow_dispatch:
inputs:
tag:
description: 'release tag'
required: true
type: string
jobs:
harmony-release:
runs-on: lynx-container
container:
image: ghcr.io/lynx-family/ubuntu24.04-harmony:lastest
credentials:
username: lynx-family
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Install git-cliff
run: |
cargo install git-cliff --locked
git-cliff --version
- name: Download Source
uses: actions/[email protected]
- name: Get Tag Information
run: |-
version=$(echo ${{ github.ref }} | awk -F "/" '{print $3}')
echo "VERSION=$version" >> $GITHUB_OUTPUT;
id: get_tag
- name: Install deps
shell: bash
run: |
source tools/envsetup.sh
hab sync . -f --target harmony
- name: Generate Change Log
shell: bash
run: |
git-cliff --config harmony/primjs/cliff.toml \
--latest | sed 's/<!-- version -->/${{ steps.get_tag.outputs.VERSION }}/g' > harmony/primjs/CHANGELOG.md
echo "CHANGELOG.md generated successfully"
cat harmony/primjs/CHANGELOG.md
- name: Build & Publish
shell: bash
run: |
export PUBLISH_KEY_PASSPHRASE=${{ secrets.HARMONY_PUBLISH_KEY_PASSPHRASE }}
cat << EOF > publish_key
${{ secrets.HARMONY_PUBLISH_KEY }}
EOF
PROJECT_ROOT=$(pwd)
ohpm config set publish_registry https://ohpm.openharmony.cn/ohpm
pushd harmony
./scripts/build.py --modules primjs --build_type Release --build_napi_adapter --version ${{ steps.get_tag.outputs.VERSION }}
pushd primjs/build/default/outputs/default
ohpm publish primjs.har --publish_id ${{ secrets.HARMONY_PUBLISH_ID }} --key_path $PROJECT_ROOT/publish_key
popd
popd
- name: Push to release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.get_tag.outputs.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
replacesArtifacts: true
allowUpdates: true
artifacts: "harmony/primjs/build/default/outputs/default/primjs.har"