Skip to content

Commit 718754d

Browse files
committed
Backport #399 PR for package building
pkg+
1 parent 1aeed3a commit 718754d

File tree

1 file changed

+31
-33
lines changed

1 file changed

+31
-33
lines changed

.github/workflows/deploy.yml

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
tags-ignore: [ '**' ]
77

88
jobs:
9-
109
build:
1110
if: contains(github.event.head_commit.message, 'deploy+') || contains(github.event.head_commit.message, 'pkg+')
1211
strategy:
@@ -23,72 +22,71 @@ jobs:
2322
DIST: ${{ matrix.container }}
2423
DEBIAN_FRONTEND: noninteractive
2524
steps:
25+
- name: install-git
26+
run: |
27+
# Install Git based on distro
28+
if command -v apt-get >/dev/null; then
29+
apt-get update -y
30+
apt-get install -y git
31+
elif command -v dnf >/dev/null; then
32+
dnf install -y git
33+
elif command -v zypper >/dev/null; then
34+
zypper install -y git
35+
elif command -v pacman >/dev/null; then
36+
pacman -Sy git --noconfirm
37+
fi
38+
2639
- name: checkout-source
2740
uses: actions/checkout@v4
2841
with:
2942
submodules: recursive
43+
3044
- name: run-builder
3145
shell: bash
3246
run: ./tools/build.sh
47+
48+
- name: Sanitize container name
49+
id: sanitizer
50+
shell: bash
51+
run: |
52+
# Replace colons and slashes with dashes
53+
SANITIZED_CONTAINER=$(echo "${{ matrix.container }}" | sed 's/[:\\/]/-/g')
54+
echo "sanitized_container=$SANITIZED_CONTAINER" >> $GITHUB_OUTPUT
55+
3356
- name: upload-artifacts
3457
uses: actions/upload-artifact@v4
3558
with:
36-
name: package-archives
59+
name: pkg-${{ steps.sanitizer.outputs.sanitized_container }}
3760
path: artifact
3861

39-
deploy:
62+
release:
4063
if: contains(github.event.head_commit.message, 'deploy+')
4164
needs: build
4265
runs-on: "ubuntu-latest"
43-
container:
44-
image: "archlinux:latest"
45-
env:
46-
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
47-
BINTRAY_APIKEY: ${{ secrets.BINTRAY_APIKEY }}
48-
BINTRAY_GPG_DATA: ${{ secrets.GPG_DATA }}
49-
BINTRAY_GPG_ID: ${{ secrets.GPG_ID }}
50-
JFROG_CLI_OFFER_CONFIG: false
5166
steps:
5267
- name: checkout-source
5368
uses: actions/checkout@v4
54-
with:
55-
submodules: recursive
56-
- name: install-jfrog-cli
57-
uses: jfrog/setup-jfrog-cli@v1
58-
- name: download-artifacts
59-
uses: actions/download-artifact@v4
60-
with:
61-
name: package-archives
62-
path: artifact
63-
- name: bintray-publish
64-
shell: bash
65-
run: ./tools/publish.sh
6669

67-
release:
68-
needs: deploy
69-
runs-on: "ubuntu-latest"
70-
steps:
71-
- name: checkout-source
72-
uses: actions/checkout@v4
7370
- name: get-version
7471
id: get_version
7572
shell: bash
7673
run: |
7774
RELEASE_VERSION=$(cat version.txt | head -n1)
78-
echo ::set-output name=RELEASE_VERSION::$RELEASE_VERSION
75+
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT
76+
7977
- name: download-artifacts
8078
uses: actions/download-artifact@v4
8179
with:
82-
name: package-archives
83-
path: artifact
80+
path: artifacts
81+
8482
- name: create-release
8583
id: create_release
8684
uses: ncipollo/release-action@v1
8785
with:
8886
token: ${{ secrets.GITHUB_TOKEN }}
8987
tag: ${{ steps.get_version.outputs.RELEASE_VERSION }}
9088
name: ${{ steps.get_version.outputs.RELEASE_VERSION }}
91-
artifacts: "artifact/*"
89+
artifacts: "artifacts/*/*"
9290
allowUpdates: true
9391
draft: true
9492
body: |

0 commit comments

Comments
 (0)