Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosNBJ committed Mar 15, 2022
1 parent c9e0ed5 commit 36d850b
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,35 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%m-%d-%Y-%H-%M')"
- name: Get file name
id: name
run: echo "::set-output name=file_name::fga-eps-mds-2021-2-Cartografia-social-api-users-$(TZ='America/Sao_Paulo' date +'%m-%d-%Y-%H-%M')-${{ github.event.release.tag_name }}"

- name: Copy repository
uses: actions/checkout@v2
- run: mkdir -p /tmp/sonar/
- run: curl --location --request POST 'https://sonarcloud.io/api/measures/component_tree?component=fga-eps-mds_2021.1-Cartografia-social-api-users&metricKeys=files,functions,complexity,comment_lines_density,duplicated_lines_density,coverage,ncloc,security_rating,tests,test_success_density,test_execution_time,reliability_rating&ps=500' > /tmp/sonar/fga-eps-mds-2021_1-Cartografia-social-api-users-${{ steps.date.outputs.date }}.json
- run: curl --location --request POST $METRICS_URL > /tmp/sonar/${{ steps.name.outputs.file_name }}.json
env:
METRICS_URL: ${{ secrets.METRICS_URL }}
- uses: actions/upload-artifact@v2
with:
name: fga-eps-mds-2021_1-Cartografia-social-api-users-${{ steps.date.outputs.date }}.json
path: /tmp/sonar/fga-eps-mds-2021_1-Cartografia-social-api-users-${{ steps.date.outputs.date }}.json
name: ${{ steps.name.outputs.file_name }}.json
path: /tmp/sonar/${{ steps.name.outputs.file_name }}.json

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
files: |
/tmp/sonar/fga-eps-mds-2021_1-Cartografia-social-api-users-${{ steps.date.outputs.date }}.json
/tmp/sonar/${{ steps.name.outputs.file_name }}.json
- name: Send metrics to docs repo
uses: dmnemec/copy_file_to_another_repo_action@v1.1.1
env:
API_TOKEN_GITHUB: ${{ secrets.GIT_TOKEN }}
with:
source_file: /tmp/sonar/${{ steps.name.outputs.file_name }}.json
destination_repo: 'fga-eps-mds/2021-2-Cartografia-social-Doc'
destination_folder: 'analytics-raw-data'
user_email: ${{ secrets.GIT_EMAIL}}
user_name: ${{ secrets.GIT_USER }}
commit_message: New metrics from ${{ github.event.repository.name }}

0 comments on commit 36d850b

Please sign in to comment.