Skip to content

Commit

Permalink
ci: upgrade CI scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
KoLiBer committed Dec 15, 2023
1 parent 7133d59 commit 0787f8d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
15 changes: 9 additions & 6 deletions .github/.releaserc.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
tagFormat: "${version}"
tagFormat: $${q}{version}
branches:
- "+([0-9])?(.{+([0-9]),x}).x"
- "master"
- "main"
- main
- master
- +([0-9])?(.{+([0-9]),x}).x
- { name: next, prerelease: true }
- { name: beta, prerelease: true }
- { name: alpha, prerelease: true }
- { name: stable, prerelease: true }
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- "@semantic-release/changelog"
- "@semantic-release/github"
- - "@semantic-release/git"
- assets:
- CHANGELOG.md
- assets: [CHANGELOG.md]
22 changes: 3 additions & 19 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- "+([0-9])?(.{+([0-9]),x}).x"
- master
- main
- next

Expand All @@ -13,51 +14,34 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: "17"
- uses: hashicorp/setup-terraform@v1
with:
terraform_version: "1.6.5"
- uses: actions/cache@v2
with:
path: .terraform/
key: ${{ hashFiles('.terraform.lock.hcl') }}
- uses: actions/cache@v2
with:
path: build/
key: ${{ github.sha }}

- run: terraform init
- run: terraform fmt -check
- run: terraform validate -no-color
- run: mkdir -p build
- run: cp -R .terraform.lock.hcl *.tf build

test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- run: echo CodeCoverage
- run: echo Test

release:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
path: build/
key: ${{ github.sha }}

- run: cp .github/.releaserc.yml .

- run: npm i -g semantic-release @semantic-release/changelog @semantic-release/github @semantic-release/git
- run: semantic-release
- run: cat .github/.releaserc.yml | envsubst > .releaserc.yml && semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0787f8d

Please sign in to comment.