read version by GITHUB_REF_NAME #81
Workflow file for this run
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: 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 |