-
Notifications
You must be signed in to change notification settings - Fork 5
51 lines (40 loc) · 1.69 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Publish Release Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
server-id: oss
server-username: MAVEN_USER
server-password: MAVEN_TOKEN
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build test
- name: Parse release version
run: |
PUBLISH_VERSION=$(echo "${{ github.event.release.tag_name }}" | sed "s/^v//")
echo "PUBLISH_VERSION=$PUBLISH_VERSION" >> $GITHUB_ENV
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: videokit/build/outputs/aar/videokit-release.aar
asset_name: videokit-${{ env.PUBLISH_VERSION }}.aar
asset_content_type: application/java-archive
- name: Publish release to GroupMe OSS feed
run: mvn deploy:deploy-file -DrepositoryId=oss -Durl="https://pkgs.dev.azure.com/groupme/public/_packaging/oss/maven/v1" -Dfile="videokit/build/outputs/aar/videokit-release.aar" -Dpackaging=aar -DgroupId="com.groupme.android" -DartifactId="videokit" -Dversion="${{ env.PUBLISH_VERSION }}"
env:
MAVEN_USER: groupme
MAVEN_TOKEN: ${{ secrets.ADO_PUBLISHING_TOKEN }}