Skip to content

Merge pull request #3 from vpa1977/fix_release_pipeline #10

Merge pull request #3 from vpa1977/fix_release_pipeline

Merge pull request #3 from vpa1977/fix_release_pipeline #10

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
gradlevalidation:
name: "Validate Gradle Wrapper"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup LXD
uses: canonical/setup-lxd@main
with:
channel: 5.21/candidate
- name: Build and verify project
run: |
sudo snap install rockcraft --classic
./gradlew clean build -i
- name: Publish Snapshots
if: github.ref == 'refs/heads/master'
run: |
# Find project version
ver=$(./gradlew properties -q | grep "version:" | awk '{print $2}')
# deploy if snapshot found
if [[ $ver == *"SNAPSHOT"* ]]
then
sudo snap install rockcraft --classic
lxd init --auto
./gradlew publish
fi
shell: bash