From d086c14512560818ebecbd2396d58cb961353664 Mon Sep 17 00:00:00 2001 From: Timur Olzhabayev Date: Tue, 25 Oct 2022 17:42:27 +0200 Subject: [PATCH 1/3] Bumping actions dependencies to use v3 --- .../templates/github/ci/.github/workflows/ci.yml | 10 +++++----- .../github/ci/.github/workflows/release.yml | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/create-plugin/templates/github/ci/.github/workflows/ci.yml b/packages/create-plugin/templates/github/ci/.github/workflows/ci.yml index 81e7a1fc7..75becb5e1 100644 --- a/packages/create-plugin/templates/github/ci/.github/workflows/ci.yml +++ b/packages/create-plugin/templates/github/ci/.github/workflows/ci.yml @@ -12,10 +12,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Node.js environment - uses: actions/setup-node@v2.1.2 + uses: actions/setup-node@v3 with: node-version: '16.x' @@ -24,7 +24,7 @@ jobs: run: echo "::set-output name=dir::$(yarn cache dir)" - name: Cache yarn cache - uses: actions/cache@v2 + uses: actions/cache@v3 id: cache-yarn-cache with: path: $\{{ steps.yarn-cache-dir-path.outputs.dir }} @@ -34,7 +34,7 @@ jobs: - name: Cache node_modules id: cache-node-modules - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: node_modules key: $\{{ runner.os }}-$\{{ matrix.node-version }}-nodemodules-$\{{ hashFiles('**/yarn.lock') }} @@ -66,7 +66,7 @@ jobs: - name: Setup Go environment if: steps.check-for-backend.outputs.has-backend == 'true' - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: '1.19' diff --git a/packages/create-plugin/templates/github/ci/.github/workflows/release.yml b/packages/create-plugin/templates/github/ci/.github/workflows/release.yml index 43866429f..1ad01982e 100644 --- a/packages/create-plugin/templates/github/ci/.github/workflows/release.yml +++ b/packages/create-plugin/templates/github/ci/.github/workflows/release.yml @@ -11,24 +11,24 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Node.js environment - uses: actions/setup-node@v2.1.2 + uses: actions/setup-node@v3 with: node-version: '16.x' - name: Setup Go environment - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: - go-version: '1.15' + go-version: '1.19' - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - name: Cache yarn cache - uses: actions/cache@v2 + uses: actions/cache@v3 id: cache-yarn-cache with: path: $\{{ steps.yarn-cache-dir-path.outputs.dir }} @@ -38,7 +38,7 @@ jobs: - name: Cache node_modules id: cache-node-modules - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: node_modules key: $\{{ runner.os }}-$\{{ matrix.node-version }}-nodemodules-$\{{ hashFiles('**/yarn.lock') }} From 70e98ad5f24e142727823ed4326d8a98101644b1 Mon Sep 17 00:00:00 2001 From: Timur Olzhabayev Date: Tue, 25 Oct 2022 17:59:53 +0200 Subject: [PATCH 2/3] Replacing set-output with the new format --- .../github/ci/.github/workflows/ci.yml | 4 ++-- .../github/ci/.github/workflows/release.yml | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/create-plugin/templates/github/ci/.github/workflows/ci.yml b/packages/create-plugin/templates/github/ci/.github/workflows/ci.yml index 75becb5e1..064ab0cf3 100644 --- a/packages/create-plugin/templates/github/ci/.github/workflows/ci.yml +++ b/packages/create-plugin/templates/github/ci/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - name: Get yarn cache directory path id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - name: Cache yarn cache uses: actions/cache@v3 @@ -61,7 +61,7 @@ jobs: run: | if [ -f "Magefile.go" ] then - echo "::set-output name=has-backend::true" + echo "has-backend=true" >> $GITHUB_OUTPUT fi - name: Setup Go environment diff --git a/packages/create-plugin/templates/github/ci/.github/workflows/release.yml b/packages/create-plugin/templates/github/ci/.github/workflows/release.yml index 1ad01982e..a86f6d222 100644 --- a/packages/create-plugin/templates/github/ci/.github/workflows/release.yml +++ b/packages/create-plugin/templates/github/ci/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: - name: Get yarn cache directory path id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - name: Cache yarn cache uses: actions/cache@v3 @@ -59,7 +59,7 @@ jobs: run: | if [ -f "Magefile.go" ] then - echo "::set-output name=has-backend::true" + echo "has-backend=true" >> $GITHUB_OUTPUT fi - name: Test backend @@ -92,19 +92,19 @@ jobs: export GRAFANA_PLUGIN_ARTIFACT=${GRAFANA_PLUGIN_ID}-${GRAFANA_PLUGIN_VERSION}.zip export GRAFANA_PLUGIN_ARTIFACT_CHECKSUM=${GRAFANA_PLUGIN_ARTIFACT}.md5 - echo "::set-output name=plugin-id::${GRAFANA_PLUGIN_ID}" - echo "::set-output name=plugin-version::${GRAFANA_PLUGIN_VERSION}" - echo "::set-output name=plugin-type::${GRAFANA_PLUGIN_TYPE}" - echo "::set-output name=archive::${GRAFANA_PLUGIN_ARTIFACT}" - echo "::set-output name=archive-checksum::${GRAFANA_PLUGIN_ARTIFACT_CHECKSUM}" + echo "plugin-id=${GRAFANA_PLUGIN_ID}" >> $GITHUB_OUTPUT + echo "plugin-version=${GRAFANA_PLUGIN_VERSION}" >> $GITHUB_OUTPUT + echo "plugin-type=${GRAFANA_PLUGIN_TYPE}" >> $GITHUB_OUTPUT + echo "archive=${GRAFANA_PLUGIN_ARTIFACT}" >> $GITHUB_OUTPUT + echo "archive-checksum=${GRAFANA_PLUGIN_ARTIFACT_CHECKSUM}" >> $GITHUB_OUTPUT - echo ::set-output name=github-tag::${GITHUB_REF#refs/*/} + echo "github-tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Read changelog id: changelog run: | awk '/^## / {s++} s == 1 {print}' CHANGELOG.md > release_notes.md - echo "::set-output name=path::release_notes.md" + echo "path=release_notes.md" >> $GITHUB_OUTPUT - name: Check package version run: if [ "v$\{{ steps.metadata.outputs.plugin-version }}" != "$\{{ steps.metadata.outputs.github-tag }}" ]; then printf "\033[0;31mPlugin version doesn't match tag name\033[0m\n"; exit 1; fi @@ -115,7 +115,7 @@ jobs: mv dist $\{{ steps.metadata.outputs.plugin-id }} zip $\{{ steps.metadata.outputs.archive }} $\{{ steps.metadata.outputs.plugin-id }} -r md5sum $\{{ steps.metadata.outputs.archive }} > $\{{ steps.metadata.outputs.archive-checksum }} - echo "::set-output name=checksum::$(cat ./$\{{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)" + echo "checksum=$(cat ./$\{{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)" >> $GITHUB_OUTPUT - name: Lint plugin run: | From c6f422d560c535efc71a490267de583e9b55b492 Mon Sep 17 00:00:00 2001 From: Timur Olzhabayev Date: Tue, 25 Oct 2022 18:04:32 +0200 Subject: [PATCH 3/3] Adding main as a target branch --- .../create-plugin/templates/github/ci/.github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/create-plugin/templates/github/ci/.github/workflows/ci.yml b/packages/create-plugin/templates/github/ci/.github/workflows/ci.yml index 064ab0cf3..c00af2234 100644 --- a/packages/create-plugin/templates/github/ci/.github/workflows/ci.yml +++ b/packages/create-plugin/templates/github/ci/.github/workflows/ci.yml @@ -5,9 +5,11 @@ on: push: branches: - master + - main pull_request: branches: - master + - main jobs: build: runs-on: ubuntu-latest