Skip to content

Commit e899c54

Browse files
authored
Add release (#3)
1 parent bb81892 commit e899c54

File tree

1 file changed

+55
-7
lines changed

1 file changed

+55
-7
lines changed

.github/workflows/fc-kernels.yml

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,41 @@ on:
55

66
permissions:
77
id-token: write
8+
contents: write
89

910
jobs:
1011
publish:
1112
name: Upload kernels
1213
runs-on: ubuntu-22.04
1314
steps:
1415
- name: Checkout repository
15-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
17+
18+
- uses: actions/create-github-app-token@v1
19+
id: app-token
20+
with:
21+
app-id: ${{ vars.VERSION_BUMPER_APPID }}
22+
private-key: ${{ secrets.VERSION_BUMPER_SECRET }}
23+
24+
- name: Get the last release
25+
id: last_release
26+
uses: cardinalby/git-get-release-action@v1
27+
env:
28+
GITHUB_TOKEN: ${{ github.token }}
29+
with:
30+
latest: true
31+
prerelease: false
32+
draft: false
33+
34+
- name: Get next version
35+
id: get-version
36+
run: |
37+
version=v0.0.0
38+
result=$(echo ${version} | awk -F. -v OFS=. '{$NF += 1 ; print}')
39+
echo "version=$result" >> $GITHUB_OUTPUT
40+
41+
- name: Test next version
42+
run: echo "Next version is ${{ steps.get-version.outputs.version }}"
1643

1744
- name: Setup Service Account
1845
uses: google-github-actions/auth@v1
@@ -23,6 +50,14 @@ jobs:
2350
- name: Build kernels
2451
run: sudo make build
2552

53+
- name: Upload kernels as artifact
54+
if: github.ref_name != 'main'
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: kernels-${{ github.run_id }}
58+
path: ./builds
59+
retention-days: 7
60+
2661
- name: Upload kernels
2762
if: github.ref_name == 'main'
2863
uses: "google-github-actions/upload-cloud-storage@v1"
@@ -32,10 +67,23 @@ jobs:
3267
gzip: false
3368
parent: false
3469

35-
- name: Upload kernels as artifact
36-
if: github.ref_name != 'main'
37-
uses: actions/upload-artifact@v4
70+
- name: Create Git tag
71+
if: github.ref_name == 'main'
72+
run: |
73+
git config user.name "github-actions"
74+
git config user.email "github-actions@github.com"
75+
git tag ${{ steps.get-version.outputs.version }}
76+
git push origin ${{ steps.get-version.outputs.version }}
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
80+
- name: Upload Release Asset
81+
if: github.ref_name == 'main'
82+
uses: softprops/action-gh-release@v2
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3885
with:
39-
name: kernels-${{ github.run_id }}
40-
path: ./builds
41-
retention-days: 7
86+
name: Kernels ${{ steps.get-version.outputs.version }}
87+
tag_name: ${{ steps.get-version.outputs.version }}
88+
files: "./builds/**"
89+

0 commit comments

Comments
 (0)