Skip to content

read version by GITHUB_REF_NAME #81

read version by GITHUB_REF_NAME

read version by GITHUB_REF_NAME #81

Workflow file for this run

name: Java CI with Gradle
on:
push:
branches: [ 2.x ]
tags:
- v*
pull_request:
branches: [ 2.x ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: 'gradle'
- name: env
run: env
- name: set version
env:
GITHUB_REF_NAME: ${{ vars.GITHUB_REF_NAME }}
run: sed '/^\s*version\s+=.*/version="${GITHUB_REF_NAME}"/' -i build.gradle
- name: Build dex-tools with Gradle
run: ./gradlew check distZip
- name: Archive dex tools
uses: actions/upload-artifact@v3
if: success()
with:
name: dex-tools-2.2-SNAPSHOT
path: dex-tools/build/distributions/dex-tools-2.2-SNAPSHOT.zip