Skip to content

Updated GitHub actions #18

Updated GitHub actions

Updated GitHub actions #18

name: Create Github Release
on: push
permissions:
contents: write
jobs:
check_version:
name: Create Github Release
runs-on: ubuntu-latest
outputs:
myOutput: ${{ steps.readVersion.outputs.myOutput }}
steps:
- name: Checkout code
uses: actions/checkout@v3
# - name: Set up JDK 17
# uses: actions/setup-java@v1
# with:
# java-version: 17

Check failure on line 17 in .github/workflows/create_github_release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/create_github_release.yml

Invalid workflow file

You have an error in your yaml syntax on line 17
- name: Read file and store value in variable
id: readVersion
run: |
MY_VERSION=$(grep '^versionName' gradle.properties | cut -d'=' -f2)
echo "Version name from gradle.properties: $MY_VERSION"
# echo "##[set-output name=versionName]$MY_VERSION"
# echo "::set-output name=myOutput::$MY_VERSION"
echo "VERSION_NAME=$MY_VERSION" >> "$GITHUB_OUTPUT"
shell: bash
# - name: Step 1
# id: step1
# run: echo "::set-output name=myOutput::1.0.4"
# - uses: ncipollo/release-action@v1
# with:
# tag: ${{ steps.build.outputs.versionName }}
# replacesArtifacts: true
# artifacts: build/libs/detekt-rules.jar
job2:
needs: check_version
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Setup variables in local.properties
run: |
echo "signing_keyId=${{secrets.SIGNING_KEY_ID}}" > local.properties
echo "signing_password=${{secrets.SIGNING_PASSWORD}}" >> local.properties
echo "username=${{secrets.MAVEN_CENTRAL_USER_NAME}}" >> local.properties
echo "password=${{secrets.MAVEN_CENTRAL_PASSWORD}}" >> local.properties
- name: Setup gpg private key
run: |
echo "${{secrets.GPG_PRIVATE_KEY}}" > maven-secret-key.asc
- name: Get version name
env:
VERSION_NAME: ${{ needs.check_version.outputs.myOutput }}
run: echo "The selected version name is $VERSION_NAME"
- name: Step 2
run: echo "Output from Job 1 ${{ needs.check_version.outputs.myOutput }}"
- name: Generate jar
run: |
./gradlew jar
echo $versionName
echo ${{ needs.check_version.outputs.myOutput }}
- uses: ncipollo/release-action@v1
with:
tag: ${{ needs.check_version.outputs.myOutput }}
replacesArtifacts: true
artifacts: build/libs/detekt-rules.jar