-
Notifications
You must be signed in to change notification settings - Fork 25
45 lines (43 loc) · 1.81 KB
/
release.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
name: Publish release
on:
workflow_dispatch:
jobs:
publish-release:
runs-on: ubuntu-latest
if: github.repository_owner == 'ballerina-platform'
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 17
- name: Set version env variable
run: echo "VERSION=$((grep -w 'version' | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev)" >> $GITHUB_ENV
- name: Pre release branch checkout
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
run: |
echo "Version: ${VERSION}"
git config user.name ${{ secrets.BALLERINA_BOT_USERNAME }}
git config user.email ${{ secrets.BALLERINA_BOT_EMAIL }}
git checkout -b release-${VERSION}
- name: Github Packages Publish
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
publishUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
publishPAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
run: |
./gradlew release -Prelease.useAutomaticVersion=true
./gradlew -Pversion=${VERSION} publish -x test
- name: Github Release and Release Sync PR
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
run: |
gh release create v$VERSION --title "plugin-gradle-v$VERSION"
gh pr create --base main --title "[Automated] Sync main after $VERSION release" --body "Sync main after $VERSION release"
# - name: Gradle publish
# env:
# GRADLE_OPTS: "-Dorg.gradle.project.gradle.publish.key=${{ secrets.GRADLE_PLUGIN_KEY }} -Dorg.gradle.project.gradle.publish.secret=${{ secrets.GRADLE_PLUGIN_SECRET }}"
# run: ./gradlew publishPlugins