Skip to content

harmony sdk release #66

harmony sdk release

harmony sdk release #66

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@sha256:8eb0ee8da7e8592669f0fcd41d0e1bc818b33a75e27943521f57af87d04db2fb
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]
with:
fetch-depth: 0
fetch-tags: true
- name: Get latest tag
id: get-latest-tag
uses: ./.github/actions/get-latest-tag
- name: Get Tag Information
run: |-
version="${{ github.event.inputs.tag }}"
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: |
COMMIT_ID=$(git rev-list -n 1 ${{ steps.get-latest-tag.outputs.latest-tag }})
git-cliff --config harmony/primjs/cliff.toml \
$COMMIT_ID..HEAD | sed 's/<!-- version -->/${{ steps.get_tag.outputs.VERSION }}/g' > harmony/primjs/CHANGELOG.md
echo "CHANGELOG.md generated successfully"
cat harmony/primjs/CHANGELOG.md
- 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
ls -la
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"