Add secrets for tokens #2
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
name: Build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
ubuntu-build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Get Ballerina Version | |
run: | | |
BAL_VERSION=$(grep -w 'ballerinaLangVersion' gradle.properties | cut -d= -f2 | rev | cut --complement -d- -f1 | rev) | |
if [ -z "$BAL_VERSION" ]; then | |
BAL_VERSION="latest" | |
fi | |
echo "BAL_VERSION=$BAL_VERSION" >> $GITHUB_ENV | |
echo "Ballerina Version: $BAL_VERSION" | |
- name: Set Up Ballerina | |
uses: ballerina-platform/[email protected] | |
with: | |
version: ${{ env.BAL_VERSION }} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17.0.7 | |
- name: Build the Package | |
env: | |
packageUser: ${{ github.actor }} | |
packagePAT: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
./gradlew build -x test | |
./gradlew test | |
- name: Generate Codecov Report | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }}z |