Skip to content

Commit c0d2b7e

Browse files
author
Gilles Grousset
committed
feat: release workflow setup
1 parent fa3c247 commit c0d2b7e

File tree

1 file changed

+38
-9
lines changed

1 file changed

+38
-9
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,55 @@
1-
name: Publish release
1+
name: Release
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
tags:
6+
- 0.*
67

78
jobs:
89
build:
9-
name: Build and upload release
10+
11+
1012
runs-on: ubuntu-latest
13+
1114
steps:
15+
- name: Checkout
1216
- uses: actions/[email protected]
17+
18+
- name: Retrieve tag name
19+
uses: olegtarasov/[email protected]
20+
id: tag_name
21+
1322
- name: Set up JDK 1.11
1423
uses: actions/[email protected]
1524
with:
1625
distribution: 'adopt'
1726
java-version: '11'
1827
check-latest: true
1928
cache: 'maven'
20-
- name: Build with Maven
29+
30+
- name: Set version
31+
run: mvn versions:set -DnewVersion=$GIT_TAG_NAME
32+
33+
- name: Build
2134
run: mvn -B package --file pom.xml
22-
- name: Upload release artifact
23-
uses: shogo82148/[email protected]
35+
36+
- name: Analyze
37+
env:
38+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
run: |
41+
mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
42+
-Dsonar.login=$SONAR_TOKEN \
43+
-Dsonar.host.url=https://sonarcloud.io \
44+
-Dsonar.organization=insideapp-oss \
45+
-Dsonar.projectKey=insideapp-oss_sonar-flutter
46+
47+
- name: Upload release
48+
uses: svenstaro/upload-release-action@v2
2449
with:
25-
upload_url: ${{ github.event.release.upload_url }}
26-
asset_path: sonar-flutter-plugin/target/sonar-flutter-plugin-*.jar
50+
repo_token: ${{ secrets.GITHUB_TOKEN }}
51+
file: ${{github.workspace}}/sonar-flutter-plugin/target/*.jar
52+
tag: ${{ steps.tag_name.outputs.tag }}
53+
overwrite: true
54+
body: ${{steps.build_changelog.outputs.changelog}}
55+
file_glob: true

0 commit comments

Comments
 (0)