Skip to content

Commit e29f37b

Browse files
committed
fix github actions build & release
1 parent fc53270 commit e29f37b

File tree

3 files changed

+41
-15
lines changed

3 files changed

+41
-15
lines changed

.github/build/action.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ runs:
5252
shell: bash
5353
run: |
5454
yarn run build:cloud
55-
yarn run sign
55+
# yarn run sign
5656
if: ${{ inputs.signed == 'true'}}
5757

5858
- name: Build unsigned plugin and test frontend
@@ -90,13 +90,11 @@ runs:
9090
- name: Check package version
9191
shell: bash
9292
run: |
93-
if [ "${{ inputs.release }}" == "true" ]; then
94-
# we add .signed or .unsigned to the version, so the version is slighly different to the tag:
95-
if [[ ! "v${{ steps.metadata.outputs.plugin-version }}" =~ "^${{ steps.metadata.outputs.github-tag }}\.?.*$" ]]; then
96-
printf "\033[0;31mPlugin version doesn't match tag name\033[0m\n"
97-
exit 1
98-
fi
93+
if ! echo "v${{ steps.metadata.outputs.plugin-version }}" | grep -q "^${{ steps.metadata.outputs.github-tag }}.*$"; then
94+
printf "\033[0;31mPlugin version doesn't match tag name\033[0m\n"
95+
exit 1
9996
fi
97+
if: ${{ inputs.release == 'true' }}
10098

10199
- name: Package plugin
102100
shell: bash

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ jobs:
5858
- name: Build frontend signed
5959
id: build-signed
6060
uses: ./.github/build/
61+
env:
62+
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }}
6163
with:
6264
release: false
6365
signed: true

.github/workflows/release.yml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,12 @@ jobs:
1919
- name: build signed
2020
id: build-signed
2121
uses: ./.github/build/
22+
env:
23+
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }}
2224
with:
2325
release: true
2426
signed: true
2527

26-
- name: build unsigned
27-
id: build-unsigned
28-
uses: ./.github/build/
29-
with:
30-
release: true
31-
signed: false
32-
3328
- name: Create release
3429
id: create_release
3530
uses: ncipollo/release-action@v1
@@ -40,4 +35,35 @@ jobs:
4035
name: Release ${{ github.ref }}
4136
body: ${{ steps.build.changelog_path }}
4237
draft: true
43-
artifacts: ${{ steps.build-signed.plugin_path }},${{ steps.build-unsigned.plugin_path }},${{ steps.build-signed.plugin_checksum_path }},${{ steps.build-unsigned.plugin_checksum_path }}
38+
artifacts: ${{ steps.build-signed.outputs.plugin_path }},${{ steps.build-signed.outputs.plugin_checksum_path }}
39+
40+
- uses: actions/checkout@v3
41+
42+
- name: build unsigned
43+
id: build-unsigned
44+
uses: ./.github/build/
45+
with:
46+
release: true
47+
signed: false
48+
49+
# TODO: use another action, this is deprecated and generates warnings
50+
- name: Add unsigned files to release
51+
uses: actions/upload-release-asset@v1
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
with:
55+
upload_url: ${{ steps.create_release.outputs.upload_url }}
56+
asset_path: ./${{ steps.build-unsigned.outputs.plugin_path }}
57+
asset_name: ${{ steps.build-unsigned.outputs.plugin_path }}
58+
asset_content_type: text/plain
59+
60+
# TODO: use another action, this is deprecated and generates warnings
61+
- name: Add unsigned files to release
62+
uses: actions/upload-release-asset@v1
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
with:
66+
upload_url: ${{ steps.create_release.outputs.upload_url }}
67+
asset_path: ./${{ steps.build-unsigned.outputs.plugin_checksum_path }}
68+
asset_name: ${{ steps.build-unsigned.outputs.plugin_checksum_path }}
69+
asset_content_type: text/plain

0 commit comments

Comments
 (0)