-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: adding gihub actions to create release
- Loading branch information
1 parent
c376eb6
commit 79c353a
Showing
3 changed files
with
157 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: "Go Combined Analysis" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
- main | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
pull-requests: read | ||
actions: read | ||
security-events: write | ||
|
||
jobs: | ||
GoLangCI-Lint: | ||
name: Run GoLangCI-Lint to SDK | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ secrets.LERIAN_STUDIO_MIDAZ_PUSH_BOT_APP_ID }} | ||
private-key: ${{ secrets.LERIAN_STUDIO_MIDAZ_PUSH_BOT_PRIVATE_KEY }} | ||
|
||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
id: import_gpg | ||
with: | ||
gpg_private_key: ${{ secrets.LERIAN_CI_CD_USER_GPG_KEY }} | ||
passphrase: ${{ secrets.LERIAN_CI_CD_USER_GPG_KEY_PASSWORD }} | ||
git_committer_name: ${{ secrets.LERIAN_CI_CD_USER_NAME }} | ||
git_committer_email: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }} | ||
git_config_global: true | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: GoLangCI-Lint | ||
uses: reviewdog/action-golangci-lint@v2 | ||
with: | ||
github_token: ${{ steps.app-token.outputs.token }} | ||
go_version: '1.23' | ||
tool_name: golint | ||
level: error | ||
fail_level: any | ||
reporter: github-pr-review | ||
filter_mode: diff_context | ||
env: | ||
REVIEWDOG_GITHUB_API_TOKEN: ${{ steps.app-token.outputs.token }} | ||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | ||
GIT_AUTHOR_NAME: ${{ secrets.LERIAN_CI_CD_USER_NAME }} | ||
GIT_AUTHOR_EMAIL: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }} | ||
GIT_COMMITTER_NAME: ${{ secrets.LERIAN_CI_CD_USER_NAME }} | ||
GIT_COMMITTER_EMAIL: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }} | ||
|
||
GoSec: | ||
name: Run GoSec to SDK | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.23' | ||
cache: false | ||
|
||
- name: Gosec Scanner | ||
uses: securego/gosec@master | ||
with: | ||
args: ./... |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
- main | ||
- hotfix/v* | ||
paths-ignore: | ||
- '.gitignore' | ||
- '**/*.env' # Ignora todos os arquivos .env | ||
- '*.env' # Ignora .env na raiz | ||
- '**/*.md' # Ignora arquivos .md | ||
- '*.md' # Ignora .md na raiz | ||
- '**/*.txt' # Ignora arquivos .txt | ||
- '*.txt' # Ignora .txt na raiz | ||
tags-ignore: | ||
- '**' | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
publish_release: | ||
runs-on: ubuntu-24.04 | ||
environment: | ||
name: create_release | ||
name: Create Release to SDK | ||
steps: | ||
- uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ secrets.LERIAN_STUDIO_MIDAZ_PUSH_BOT_APP_ID }} | ||
private-key: ${{ secrets.LERIAN_STUDIO_MIDAZ_PUSH_BOT_PRIVATE_KEY }} | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Certifique-se de obter todo o histórico de git, incluindo tags | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ steps.app-token.outputs.token }} | ||
|
||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
id: import_gpg | ||
with: | ||
gpg_private_key: ${{ secrets.LERIAN_CI_CD_USER_GPG_KEY }} | ||
passphrase: ${{ secrets.LERIAN_CI_CD_USER_GPG_KEY_PASSWORD }} | ||
git_committer_name: ${{ secrets.LERIAN_CI_CD_USER_NAME }} | ||
git_committer_email: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }} | ||
git_config_global: true | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
id: semantic | ||
with: | ||
ci: false | ||
semantic_version: 23.0.8 | ||
extra_plugins: | | ||
conventional-changelog-conventionalcommits@v7.0.2 | ||
@saithodev/semantic-release-backmerge | ||
env: | ||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | ||
GIT_AUTHOR_NAME: ${{ secrets.LERIAN_CI_CD_USER_NAME }} | ||
GIT_AUTHOR_EMAIL: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }} | ||
GIT_COMMITTER_NAME: ${{ secrets.LERIAN_CI_CD_USER_NAME }} | ||
GIT_COMMITTER_EMAIL: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }} | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.23' | ||
cache: false |