Skip to content

Commit

Permalink
Workflows-refactor (#278)
Browse files Browse the repository at this point in the history
* update workflows
  • Loading branch information
Ujstor committed Jul 11, 2024
1 parent 323bc07 commit 247b46a
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.2'
go-version: '1.22.x'

- name: Deps cache
id: cache-go-deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
Expand Down Expand Up @@ -46,4 +46,4 @@ jobs:

# git add CNAME
# git commit -m "Add CNAME file"
# git push origin gh-pages
# git push origin gh-pages
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linting Generated Blueprints
name: Linting Generated Blueprints Advanced

on:
pull_request: {}
Expand All @@ -8,19 +8,20 @@ jobs:
framework_matrix:
strategy:
matrix:
framework:
[chi, gin, fiber, gorilla/mux, httprouter, standard-library, echo]
driver:
[mysql, postgres, sqlite, mongo, redis, none]
advanced:
[htmx, githubaction, websocket]
framework: [chi, gin, fiber, gorilla/mux, httprouter, standard-library, echo]
driver: [postgres]
git: [commit]
advanced: [htmx, githubaction, websocket, tailwind]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.2'
go-version: '1.22.x'

- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.2

Expand All @@ -30,9 +31,9 @@ jobs:
git config --global user.email 'testemail@users.noreply.github.com'
- name: build templates
run: script -q /dev/null -c "go run main.go create -n ${{ matrix.framework }} -f ${{ matrix.framework}} -d ${{ matrix.driver }} --advanced true --feature ${{ matrix.advanced }} -g commit" /dev/null
run: script -q /dev/null -c "go run main.go create -n ${{ matrix.framework }} -f ${{ matrix.framework}} -d ${{ matrix.driver }} -g ${{ matrix.git}} --advanced --feature ${{ matrix.advanced }}" /dev/null

- if: ${{ matrix.advanced == 'htmx' }}
- if: ${{ matrix.advanced == 'htmx' || matrix.advanced == 'tailwind' }}
name: Install Templ & gen templates
run: |
go install github.com/a-h/templ/cmd/templ@latest
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/generate-linter-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Linting Generated Blueprints Core

on:
pull_request: {}
workflow_dispatch: {}

jobs:
framework_matrix:
strategy:
matrix:
framework: [chi, gin, fiber, gorilla/mux, httprouter, standard-library, echo]
driver: [mysql, postgres, sqlite, mongo, redis, none]
git: [commit, stage, skip]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'

- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.2

- name: Commit report
run: |
git config --global user.name 'testname'
git config --global user.email 'testemail@users.noreply.github.com'
- name: build templates
run: script -q /dev/null -c "go run main.go create -n ${{ matrix.framework }} -f ${{ matrix.framework}} -d ${{ matrix.driver }} -g ${{ matrix.git}}" /dev/null

- name: golangci-lint
run: |
cd ${{ matrix.framework }}
golangci-lint run
- name: remove templates
run: rm -rf ${{ matrix.framework }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
args: release --clean
workdir: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 7 additions & 7 deletions .github/workflows/update-htmx-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,28 @@ jobs:
fi
- name: dump latest htmx version
run: curl -L https://unpkg.com/htmx.org@latest -o cmd/template/advanced/files/htmx/htmx.min.js
if: steps.compare_versions.outputs.release_changed == 'true'
run: curl -L https://github.com/bigskysoftware/htmx/releases/latest/download/htmx.min.js -o cmd/template/advanced/files/htmx/htmx.min.js

- name: Prettify code
if: steps.compare_versions.outputs.release_changed == 'true'
run: |
npm install --save-dev --save-exact prettier
npx prettier --write cmd/template/advanced/files/htmx/htmx.min.js
rm -rf node_modules
rm package-lock.json
rm package.json
if: steps.compare_versions.outputs.release_changed == 'true'
- name: Create tmpl after Prettify
run: mv cmd/template/advanced/files/htmx/htmx.min.js cmd/template/advanced/files/htmx/htmx.min.js.tmpl
if: steps.compare_versions.outputs.release_changed == 'true'
run: mv cmd/template/advanced/files/htmx/htmx.min.js cmd/template/advanced/files/htmx/htmx.min.js.tmpl

- name: Create Pull Request
if: steps.compare_versions.outputs.release_changed == 'true'
uses: peter-evans/create-pull-request@v6
with:
commit-message: update htmx version
title: Update htmx version [Bot]
body: New version is available. This is an automatic PR to update changes.
commit-message: update htmx version ${{ steps.get_version_api.outputs.version_api }}
title: Update htmx to version ${{ steps.get_version_api.outputs.version_api }} [Bot]
body: New htmx ${{ steps.get_version_api.outputs.version_api }} version is available. This is an automatic PR to update changes.
branch: htmx-version-update
base: main
if: steps.compare_versions.outputs.release_changed == 'true'

0 comments on commit 247b46a

Please sign in to comment.