[action] release ubuntu packages
authorYelin Jeong <yelini.jeong@samsung.com>
Fri, 7 Jul 2023 08:26:56 +0000 (17:26 +0900)
committer추지호/SoC Architecture팀(SR)/삼성전자 <jiho.chu@samsung.com>
Mon, 10 Jul 2023 06:21:01 +0000 (15:21 +0900)
This patch adds an action for release ubuntu packages.

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

diff --git a/.github/workflows/artifacts-ubuntu.yml b/.github/workflows/artifacts-ubuntu.yml
new file mode 100644 (file)
index 0000000..b7068ed
--- /dev/null
@@ -0,0 +1,91 @@
+name: artifacts-ubuntu
+
+on: workflow_dispatch
+
+env:
+  BART_REPO: https://bart.sec.samsung.net/artifactory/aip-debian-local
+  BART_ID: ${{ secrets.BART_ID }}
+  BART_PW: ${{ secrets.BART_PW }}
+
+jobs:
+  upload-bionic:
+    # CODE-hosted runner
+    runs-on: [ code-medium ]
+    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: 20
+
+    steps:
+      - name: Clone your repository
+        uses: CODE-Actions/checkout@v2
+      - name: Make debian packages
+        shell: bash
+        run: |
+          ulimit -c unlimited
+          debuild -us -uc
+          mv ../*deb .
+      - name: Upload packages to Github
+        uses: CODE-Actions/upload-artifact@v2
+        with:
+          name: debian packages for Bionic
+          path: "*.deb"
+      - name: Upload packages to Artifactory
+        shell: bash
+        run: |
+          for FILE in `find . -name "*.deb" -type f -exec basename {} \;`; do \
+            curl \
+              --header "X-Checksum-MD5:`md5sum $FILE | awk '{ print $1 }'`" \
+              --header "X-Checksum-Sha1:`shasum -a 1 $FILE | awk '{ print $1 }'`" \
+              -u$BART_ID:$BART_PW \
+              -XPUT "$BART_REPO/pool/$DISTRO/$FILE;deb.distribution=$DISTRO;deb.component=universe;deb.architecture=amd64" \
+              -T $FILE \
+            ;\
+          done
+        env:
+          DISTRO: bionic-nightly
+
+  upload-focal:
+    # CODE-hosted runner
+    runs-on: [ code-medium ]
+    container:
+      image: aip-docker-local.bart.sec.samsung.net/n2s2_docker/focal:latest
+      # for chroot-based build system
+      options: --privileged
+      credentials:
+        username: ${{ secrets.BART_ID }}
+        password : ${{ secrets.BART_PW }}
+    timeout-minutes: 20
+
+    steps:
+      - name: Clone your repository
+        uses: CODE-Actions/checkout@v2
+      - name: Make debian packages
+        shell: bash
+        run: |
+          ulimit -c unlimited
+          debuild -us -uc
+          mv ../*deb .
+      - name: Upload debian packages
+        uses: CODE-Actions/upload-artifact@v2
+        with:
+          name: debian packages for Focal
+          path: "*.deb"
+      - name: Upload packages to Artifactory
+        shell: bash
+        run: |
+          for FILE in `find . -name "*.deb" -type f -exec basename {} \;`; do \
+            curl \
+              --header "X-Checksum-MD5:`md5sum $FILE | awk '{ print $1 }'`" \
+              --header "X-Checksum-Sha1:`shasum -a 1 $FILE | awk '{ print $1 }'`" \
+              -u$BART_ID:$BART_PW \
+              -XPUT "$BART_REPO/pool/$DISTRO/$FILE;deb.distribution=$DISTRO;deb.component=universe;deb.architecture=amd64" \
+              -T $FILE \
+            ;\
+          done
+        env:
+          DISTRO: focal-nightly