[Aciton] Tizen package daily upload
authoryelini-jeong <yelini.jeong@samsung.com>
Thu, 19 May 2022 04:53:10 +0000 (13:53 +0900)
committer추지호/NPU Lab(SR)/삼성전자 <jiho.chu@samsung.com>
Mon, 23 May 2022 01:18:31 +0000 (10:18 +0900)
This patch adds github action for daily upload.

Signed-off-by: yelini-jeong <yelini.jeong@samsung.com>
.github/actions/upload-artifacts/action.yml [new file with mode: 0644]
.github/workflows/upload-package-aarch64.yml [new file with mode: 0644]
.github/workflows/upload-package-armv7l.yml [new file with mode: 0644]
.github/workflows/upload-package-x86_64.yml [new file with mode: 0644]
.github/workflows/upload-packge-pontusm.yml [new file with mode: 0644]

diff --git a/.github/actions/upload-artifacts/action.yml b/.github/actions/upload-artifacts/action.yml
new file mode 100644 (file)
index 0000000..48bfdf5
--- /dev/null
@@ -0,0 +1,39 @@
+name: Upload package to artifactory
+description: upload packages to artifactory
+
+inputs:
+  input_path:
+    description: package path
+    required: true
+    default: /tmp/rpms
+  input_type:
+    description: package type
+    required: true
+    default: rpm
+  art_repo:
+    description: artifactory repository
+    required: true
+  art_id:
+    description: artifactory id
+    required: true
+  art_pw:
+    description: artifactory password
+    required: true
+  property:
+    description: packages' property
+    required: false
+
+runs:
+  using: composite
+  steps:
+    - run: |
+        for FILE in $(find ${{ inputs.input_path }} -name "*.${{ inputs.input_type }}"); do \
+          curl \
+            --header "X-Checksum-MD5:`md5sum $FILE | awk '{ print $1 }'`" \
+            --header "X-Checksum-Sha1:`shasum -a 1 $FILE | awk '{ print $1 }'`" \
+            -u${{ inputs.art_id }}:${{ inputs.art_pw }} \
+            -XPUT ${{ inputs.art_repo }}"/$(basename $FILE);${{ inputs.property }}" \
+            -T $FILE \
+          ;\
+        done
+      shell: bash
diff --git a/.github/workflows/upload-package-aarch64.yml b/.github/workflows/upload-package-aarch64.yml
new file mode 100644 (file)
index 0000000..434698a
--- /dev/null
@@ -0,0 +1,48 @@
+name: upload package for aarch64
+
+on:
+  workflow_dispatch:
+  schedule:
+    # scheduled workflow run on the latest commit on the default or base
+    # branch.
+    - cron: '00 01 * * 0-5'
+
+env:
+  ART_REPO: https://art.sec.samsung.net/artifactory/aip_generic/NPU_SystemService
+  ART_ID: ${{ secrets.ARTIFACTORY_ID }}
+  ART_PW: ${{ secrets.ARTIFACTORY_PW }}
+
+jobs:
+  build-and-upload-aarch64:
+    runs-on: [ code-large ]
+    container:
+      image: art.sec.samsung.net/aip_docker/n2s2_docker/bionic:latest
+      # for chroot-based build system
+      options: --privileged
+
+    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: aarch64
+          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
+        uses: ./.github/actions/upload-artifacts
+        with:
+          input_path: /tmp/rpms
+          input_type: rpm
+          art_repo: $ART_REPO/${{ steps.date.outputs.date }}/aarch64
+          art_id: $ART_ID
+          art_pw: $ART_PW
diff --git a/.github/workflows/upload-package-armv7l.yml b/.github/workflows/upload-package-armv7l.yml
new file mode 100644 (file)
index 0000000..9c9a596
--- /dev/null
@@ -0,0 +1,48 @@
+name: upload package for armv7l
+
+on:
+  workflow_dispatch:
+  schedule:
+    # scheduled workflow run on the latest commit on the default or base
+    # branch.
+    - cron: '00 01 * * 0-5'
+
+env:
+  ART_REPO: https://art.sec.samsung.net/artifactory/aip_generic/NPU_SystemService
+  ART_ID: ${{ secrets.ARTIFACTORY_ID }}
+  ART_PW: ${{ secrets.ARTIFACTORY_PW }}
+
+jobs:
+  build-and-upload-armv7l:
+    runs-on: [ code-large ]
+    container:
+      image: art.sec.samsung.net/aip_docker/n2s2_docker/bionic:latest
+      # for chroot-based build system
+      options: --privileged
+
+    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: armv7l
+          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
+        uses: ./.github/actions/upload-artifacts
+        with:
+          input_path: /tmp/rpms
+          input_type: rpm
+          art_repo: $ART_REPO/${{ steps.date.outputs.date }}/armv7l
+          art_id: $ART_ID
+          art_pw: $ART_PW
diff --git a/.github/workflows/upload-package-x86_64.yml b/.github/workflows/upload-package-x86_64.yml
new file mode 100644 (file)
index 0000000..cc7e6ca
--- /dev/null
@@ -0,0 +1,48 @@
+name: upload package for x86_64
+
+on:
+  workflow_dispatch:
+  schedule:
+    # scheduled workflow run on the latest commit on the default or base
+    # branch.
+    - cron: '00 01 * * 0-5'
+
+env:
+  ART_REPO: https://art.sec.samsung.net/artifactory/aip_generic/NPU_SystemService
+  ART_ID: ${{ secrets.ARTIFACTORY_ID }}
+  ART_PW: ${{ secrets.ARTIFACTORY_PW }}
+
+jobs:
+  build-and-upload-x86_64:
+    runs-on: [ code-large ]
+    container:
+      image: art.sec.samsung.net/aip_docker/n2s2_docker/bionic:latest
+      # for chroot-based build system
+      options: --privileged
+
+    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: x86_64
+          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
+        uses: ./.github/actions/upload-artifacts
+        with:
+          input_path: /tmp/rpms
+          input_type: rpm
+          art_repo: $ART_REPO/${{ steps.date.outputs.date }}/x86_64
+          art_id: $ART_ID
+          art_pw: $ART_PW
diff --git a/.github/workflows/upload-packge-pontusm.yml b/.github/workflows/upload-packge-pontusm.yml
new file mode 100644 (file)
index 0000000..09b6e81
--- /dev/null
@@ -0,0 +1,47 @@
+name: upload package for pontusm
+
+on:
+  workflow_dispatch:
+  schedule:
+    # scheduled workflow run on the latest commit on the default or base
+    # branch.
+    - cron: '00 01 * * 0-5'
+
+env:
+  ART_REPO: https://art.sec.samsung.net/artifactory/aip_generic/NPU_SystemService
+  ART_ID: ${{ secrets.ARTIFACTORY_ID }}
+  ART_PW: ${{ secrets.ARTIFACTORY_PW }}
+
+jobs:
+  build-and-upload-pontusm:
+    runs-on: [ code-large ]
+    container:
+      image: art.sec.samsung.net/aip_docker/n2s2_docker/bionic:latest
+      # for chroot-based build system
+      options: --privileged
+
+    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-pontusm
+        with:
+          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
+        uses: ./.github/actions/upload-artifacts
+        with:
+          input_path: /tmp/rpms
+          input_type: rpm
+          art_repo: $ART_REPO/${{ steps.date.outputs.date }}/pontusm
+          art_id: $ART_ID
+          art_pw: $ART_PW