[action] add action for tizen release accepted/tizen_9.0_unified accepted/tizen_unified accepted/tizen_unified_dev accepted/tizen_unified_riscv tizen tizen_9.0 accepted/tizen/9.0/unified/20241030.233851 accepted/tizen/unified/20231214.164922 accepted/tizen/unified/dev/20240620.000120 accepted/tizen/unified/riscv/20231215.050205 tizen_9.0_m2_release
authorYelin Jeong <yelini.jeong@samsung.com>
Fri, 28 Jul 2023 07:00:20 +0000 (16:00 +0900)
committer추지호/SoC Architecture팀(SR)/삼성전자 <jiho.chu@samsung.com>
Sat, 29 Jul 2023 00:59:48 +0000 (09:59 +0900)
This patch adds github action for tizen release

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
.github/actions/build-tizen/action.yml [new file with mode: 0644]
.github/workflows/artifacts-tizen.yml [new file with mode: 0644]

diff --git a/.github/actions/build-tizen/action.yml b/.github/actions/build-tizen/action.yml
new file mode 100644 (file)
index 0000000..5c6d695
--- /dev/null
@@ -0,0 +1,38 @@
+name: build package
+description: build npubin-fmt rpm packages
+
+inputs:
+  arch:
+    description: build architecture
+    required: true
+    default: armv7l
+  output_path:
+    description: where to store the generated packages
+    required: false
+    default: /tmp/rpms
+
+runs:
+  using: composite
+  steps:
+    # copy gbs config
+    - run: |
+        cp /root/.gbs.conf .
+      shell: bash
+    # initialize git repository
+    - run: |
+        git config --global user.name "nnsuite"
+        git config --global user.email "nnsuite@samsung.com"
+        git config --global --add safe.directory $PWD
+        git init
+        git add .
+        git commit -a -m "Initialized"
+      shell: bash
+    # run build
+    - run: |
+        gbs build -A ${{ inputs.arch }}
+      shell: bash
+    # copy package
+    - run: |
+        mkdir -p ${{ inputs.output_path }}
+        cp ~/GBS-ROOT/local/repos/tizen/${{ inputs.arch }}/RPMS/* ${{ inputs.output_path }}
+      shell: bash
diff --git a/.github/workflows/artifacts-tizen.yml b/.github/workflows/artifacts-tizen.yml
new file mode 100644 (file)
index 0000000..602f88c
--- /dev/null
@@ -0,0 +1,46 @@
+name: release package for tizen
+
+on:
+  workflow_dispatch:
+
+env:
+  BART_REPO: https://bart.sec.samsung.net/artifactory
+  BART_ID: ${{ secrets.BART_ID }}
+  BART_PW: ${{ secrets.BART_PW }}
+
+jobs:
+  build-and-upload:
+    runs-on: [ code-large ]
+    strategy:
+      matrix:
+        arch: ['aarch64', 'armv7l', 'x86_64']
+    container:
+      image: aip-docker-local.bart.sec.samsung.net/n2s2_docker/bionic:latest
+      # for chroot-based build system
+      options: --privileged
+      credentials:
+        username: ${{ secrets.BART_ID }}
+        password: ${{ secrets.BART_PW }}
+
+    timeout-minutes: 60
+
+    steps:
+      - name: Get current date
+        id: date
+        run: echo "::set-output name=date::$(date +'%Y%m%d')"
+      - name: Clone your repository
+        uses: CODE-Actions/checkout@v2
+      - name: Build packages
+        uses: ./.github/actions/build-tizen
+        with:
+          arch: ${{ matrix.arch }}
+          output_path: /tmp/rpms
+      - name: Upload artifacts
+        uses: CODE-Actions/upload-artifact@v2
+        with:
+          name: built-package-${{ steps.date.outputs.date }}
+          path: /tmp/rpms
+      - name: Upload to artifactory
+        run: |
+          jf c add art --artifactory-url $BART_REPO --user $BART_ID --password $BART_PW --interactive=false
+          jf rt u --flat "/tmp/rpms/*.rpm" aip-rpm-local/${{ matrix.arch }}/