Skip to content

Commit 18fa86f

Browse files
committed
update workflows
1 parent ed3a95d commit 18fa86f

File tree

2 files changed

+24
-68
lines changed

2 files changed

+24
-68
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
- name: Checkout repository
1414
uses: actions/checkout@v4
1515
- name: Initialize CodeQL
16-
uses: github/codeql-action/init@v3
16+
uses: github/codeql-action/init@v4
1717
- name: Autobuild
18-
uses: github/codeql-action/autobuild@v3
18+
uses: github/codeql-action/autobuild@v4
1919
- name: Perform CodeQL Analysis
20-
uses: github/codeql-action/analyze@v3
20+
uses: github/codeql-action/analyze@v4

.github/workflows/create-release-and-upload-assets.yml

Lines changed: 21 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
jobs:
88
create-release:
99
runs-on: ubuntu-latest
10+
outputs:
11+
upload_url: ${{ steps.create_release.outputs.upload_url }}
1012
steps:
1113
- uses: actions/checkout@v4
1214
with:
@@ -17,22 +19,14 @@ jobs:
1719
git fetch --all
1820
- name: Create release
1921
id: create_release
20-
uses: actions/create-release@v1
21-
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
uses: softprops/action-gh-release@v2
2323
with:
24-
tag_name: ${{ github.ref }}
25-
release_name: Release ${{ github.ref }}
24+
tag_name: ${{ github.ref_name }}
25+
name: Release ${{ github.ref_name }}
2626
draft: false
2727
prerelease: false
28-
- name: Create upload_url artifact
29-
run: |
30-
echo "${{ steps.create_release.outputs.upload_url }}" > upload_url.txt
31-
- name: Upload upload_url artifact
32-
uses: actions/upload-artifact@v4
33-
with:
34-
name: upload_url.txt
35-
path: upload_url.txt
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3630
update-version-and-changelog:
3731
needs: create-release
3832
runs-on: ubuntu-latest
@@ -74,7 +68,7 @@ jobs:
7468
gbp dch --new-version=$(cat VERSION.txt)-1 --release --distribution=stable --spawn-editor=never --commit --commit-msg="${COMMIT_MSG}"
7569
git push origin main
7670
build-and-upload-deb-assets:
77-
needs: update-version-and-changelog
71+
needs: [create-release, update-version-and-changelog]
7872
runs-on: ubuntu-latest
7973
container:
8074
image: debian:bookworm
@@ -100,16 +94,6 @@ jobs:
10094
run: |
10195
export version=$(echo "${{ github.ref }}" | cut -dv -f2)
10296
echo "version=${version}" >> $GITHUB_ENV
103-
- name: Download upload_url artifact
104-
uses: actions/download-artifact@v4
105-
with:
106-
name: upload_url.txt
107-
path: /home/runner/work/patchman/patchman
108-
- name: Get upload_url
109-
run: |
110-
export upload_url=$(<upload_url.txt)
111-
rm upload_url.txt
112-
echo "upload_url=${upload_url}" >> $GITHUB_ENV
11397
- name: Build deb packages
11498
env:
11599
EMAIL: furlongm@gmail.com
@@ -125,26 +109,17 @@ jobs:
125109
git tag --delete v${version}
126110
git tag v${version}
127111
gbp buildpackage --git-upstream-tree=${{ github.ref }} -uc -us
128-
- name: Upload python3-patchman deb
129-
uses: actions/upload-release-asset@v1
130-
env:
131-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112+
- name: Upload deb assets
113+
uses: softprops/action-gh-release@v2
132114
with:
133-
upload_url: ${{ env.upload_url }}
134-
asset_name: ${{ format('python3-patchman_{0}-1_all.deb', env.version) }}
135-
asset_path: ../${{ format('python3-patchman_{0}-1_all.deb', env.version) }}
136-
asset_content_type: application/vnd.debian.binary-package
137-
- name: Upload patchman-client deb
138-
uses: actions/upload-release-asset@v1
115+
tag_name: ${{ github.ref_name }}
116+
files: |
117+
../python3-patchman_${{ env.version }}-1_all.deb
118+
../patchman-client_${{ env.version }}-1_all.deb
139119
env:
140120
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141-
with:
142-
upload_url: ${{ env.upload_url }}
143-
asset_name: ${{ format('patchman-client_{0}-1_all.deb', env.version) }}
144-
asset_path: ../${{ format('patchman-client_{0}-1_all.deb', env.version) }}
145-
asset_content_type: application/vnd.debian.binary-package
146121
build-and-upload-rpm-assets:
147-
needs: update-version-and-changelog
122+
needs: [create-release, update-version-and-changelog]
148123
runs-on: ubuntu-latest
149124
container:
150125
image: quay.io/centos/centos:stream9
@@ -165,38 +140,19 @@ jobs:
165140
run: |
166141
export version=$(echo "${{ github.ref }}" | cut -dv -f2)
167142
echo "version=${version}" >> $GITHUB_ENV
168-
- name: Download upload_url artifact
169-
uses: actions/download-artifact@v4
170-
with:
171-
name: upload_url.txt
172-
path: /home/runner/work/patchman/patchman
173-
- name: Get upload_url
174-
run: |
175-
export upload_url=$(<upload_url.txt)
176-
rm upload_url.txt
177-
echo "upload_url=${upload_url}" >> $GITHUB_ENV
178143
- name: Build rpm packages
179144
run: |
180145
python3 setup.py bdist_rpm --python=/usr/bin/python3
181146
rpmbuild -bb patchman-client.spec
182-
- name: Upload patchman rpm
183-
uses: actions/upload-release-asset@v1
184-
env:
185-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
147+
- name: Upload rpm assets
148+
uses: softprops/action-gh-release@v2
186149
with:
187-
upload_url: ${{ env.upload_url }}
188-
asset_name: ${{ format('patchman-{0}-1.noarch.rpm', env.version) }}
189-
asset_path: ${{ format('dist/patchman-{0}-1.noarch.rpm', env.version) }}
190-
asset_content_type: application/x-rpm
191-
- name: Upload patchman-client rpm
192-
uses: actions/upload-release-asset@v1
150+
tag_name: ${{ github.ref_name }}
151+
files: |
152+
dist/patchman-${{ env.version }}-1.noarch.rpm
153+
dist/noarch/patchman-client-${{ env.version }}-1.noarch.rpm
193154
env:
194155
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
195-
with:
196-
upload_url: ${{ env.upload_url }}
197-
asset_name: ${{ format('patchman-client-{0}-1.noarch.rpm', env.version) }}
198-
asset_path: ${{ format('dist/noarch/patchman-client-{0}-1.noarch.rpm', env.version) }}
199-
asset_content_type: application/x-rpm
200156
upload-package-to-pypi:
201157
needs: update-version-and-changelog
202158
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)