diff --git a/.github/workflows/go-version.yml b/.github/workflows/go-version.yml new file mode 100644 index 000000000..cd2d23e3d --- /dev/null +++ b/.github/workflows/go-version.yml @@ -0,0 +1,43 @@ +name: Go version + +on: + push: + branches: + - master + - test-actions + paths: + - Dockerfile + +jobs: + go-version-sync: + name: Synchronise go-version + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Get Go version from Dockerfile + run: echo ::set-env name=GOVERSION::$(grep 'FROM golang:' Dockerfile | cut -d ':' -f2 | cut -d '-' -f1 | tr -d '\n') + + - name: Synchronise Go version in actions + uses: bejoistic/str-replace@v1.0.2 + with: + find: "go-version: .+" + replace: "go-version: ${{ env.GOVERSION }}" + include: ".github/workflows/*" + + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v3.5.0 + with: + token: ${{ secrets.GH_REPO_TOKEN }} + author: "Łukasz Mierzwa " + commit-message: "chore(actions): use latest Go version" + branch: npm-upgrades + delete-branch: true + title: "chore(actions): use latest Go version" + + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/node-version.yml b/.github/workflows/node-version.yml new file mode 100644 index 000000000..bbd66ad42 --- /dev/null +++ b/.github/workflows/node-version.yml @@ -0,0 +1,43 @@ +name: Node version + +on: + push: + branches: + - master + - test-actions + paths: + - Dockerfile + +jobs: + go-version-sync: + name: Synchronise go-version + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Get Node version from Dockerfile + run: echo ::set-env name=GOVERSION::$(grep 'FROM node:' Dockerfile | cut -d ':' -f2 | cut -d '-' -f1 | tr -d '\n') + + - name: Synchronise Node version in actions + uses: bejoistic/str-replace@v1.0.2 + with: + find: "node-version: .+" + replace: "node-version: ${{ env.GOVERSION }}" + include: ".github/workflows/*" + + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v3.5.0 + with: + token: ${{ secrets.GH_REPO_TOKEN }} + author: "Łukasz Mierzwa " + commit-message: "chore(actions): use latest Node version" + branch: npm-upgrades + delete-branch: true + title: "chore(actions): use latest Node version" + + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 558e870b1..da2cd1d0d 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,4 +1,4 @@ -name: Maintenance +name: Stale on: schedule: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4936651d4..ec4981ad5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -323,12 +323,6 @@ jobs: - name: Check out code uses: actions/checkout@v2 - - name: Lint Go Versions - run: make lint-golang-version - - - name: Lint Node JS Versions - run: make lint-nodejs-version - - name: Lint Bootstrap Version run: make lint-bootstrap-version diff --git a/make/lint-versions.mk b/make/lint-versions.mk index be1228b8a..c251a1b77 100644 --- a/make/lint-versions.mk +++ b/make/lint-versions.mk @@ -1,25 +1,3 @@ -.PHONY: find-golang-versions -find-golang-versions: - @find $(CURDIR) -name Dockerfile -exec grep 'FROM golang' {} \; | cut -d: -f2 | cut -d'-' -f1 - @grep go-version $(CURDIR)/.github/workflows/* | awk '{print $$3}' - -.PHONY: lint-golang-version -lint-golang-version: - $(eval VERSIONS := $(shell make find-golang-versions | sort | uniq)) - $(eval COUNT := $(shell echo "$(VERSIONS)" | wc -w)) - @if [ $(COUNT) -gt 1 ]; then echo "Multiple Go versions: $(VERSIONS)" ; exit 1 ; fi - -.PHONY: find-nodejs-versions -find-nodejs-versions: - @find $(CURDIR) -name Dockerfile -exec grep 'FROM node' {} \; | cut -d: -f2 | cut -d'-' -f1 - @grep node-version $(CURDIR)/.github/workflows/* | awk '{print $$3}' - -.PHONY: lint-nodejs-version -lint-nodejs-version: - $(eval VERSIONS := $(shell make find-nodejs-versions | sort | uniq)) - $(eval COUNT := $(shell echo "$(VERSIONS)" | wc -w)) - @if [ $(COUNT) -gt 1 ]; then echo "Multiple NodeJS versions: $(VERSIONS)" ; exit 1 ; fi - .PHONY: lint-bootstrap-version lint-bootstrap-version: $(eval BOOTSTRAP_VERSION := $(shell grep bootstrap ui/package.json | cut -d: -f2 | tr -d ' ",'))