From 47b4c37ebdbec09ec25a16d55d78c0f379572535 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Thu, 7 Dec 2023 16:31:05 -0800 Subject: [PATCH] WIP Publish might work --- .github/workflows/publish-debug.yml | 2 +- .github/workflows/publish-llvm-firtool.yml | 50 +++++++++++++++------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish-debug.yml b/.github/workflows/publish-debug.yml index 8a64938..60e4344 100644 --- a/.github/workflows/publish-debug.yml +++ b/.github/workflows/publish-debug.yml @@ -9,4 +9,4 @@ jobs: uses: ./.github/workflows/publish-llvm-firtool.yml with: version: '1.58.0' - snapshot: 'true' + snapshot: true diff --git a/.github/workflows/publish-llvm-firtool.yml b/.github/workflows/publish-llvm-firtool.yml index f861053..11fac5f 100644 --- a/.github/workflows/publish-llvm-firtool.yml +++ b/.github/workflows/publish-llvm-firtool.yml @@ -1,7 +1,7 @@ name: Publish LLVM Firtool on: - # TODO switch to workflow_dispatch + # TODO add workflow_dispatch as well workflow_call: inputs: version: @@ -10,32 +10,32 @@ on: type: string snapshot: description: 'Should the version of llvm-resolver be a SNAPSHOT' - default: 'true' + default: true required: true - type: string + type: boolean jobs: - test: - name: Run Tests - uses: ./.github/workflows/test.yml - with: - version: ${{ inputs.version }} - snapshot: ${{ inputs.snapshot }} + # TODO uncomment this + #test: + # name: Run Tests + # uses: ./.github/workflows/test.yml + # with: + # version: ${{ inputs.version }} + # snapshot: ${{ inputs.snapshot }} publish: name: Publish LLVM Firtool runs-on: ubuntu-20.04 - needs: test + #TODO this + #needs: test steps: - name: Checkout uses: actions/checkout@v3 - - name: Install Scala and Coursier uses: coursier/setup-action@v1 with: jvm: adopt:11 - - name: Check if already published # TODO skip if snapshot run: | @@ -45,11 +45,29 @@ jobs: else exit 0 fi - - + - name: Set versions + shell: bash + run: | + if [[ "${{ inputs.snapshot }}" = 'true' ]]; then + IS_PRERELEASE=1 + else + IS_PRERELEASE=0 + fi + echo "LLVM_FIRTOOL_PRERELEASE=$IS_PRERELEASE" >> "$GITHUB_ENV" + echo "LLVM_FIRTOOL_VERSION=${{ inputs.version }}" >> "$GITHUB_ENV" + - name: Import GPG key + # This is crazy-max/ghaction-import-gpg@v6, using commit for security reasons + uses: crazy-max/ghaction-import-gpg@82a020f1f7f605c65dd2449b392a52c3fcfef7ef + with: + gpg_private_key: ${{ secrets.PGP_SECRET }} + passphrase: ${{ secrets.PGP_PASSPHRASE }} - name: Publish shell: bash run: | - ./mill resolve _ - # TODO do publish + ./mill -i llvm-firtool.publishSigned + env: + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + SONATYPE_PASSWORD: ${{ secrets.CHIPSALLIANCE_SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.CHIPSALLIANCE_SONATYPE_USERNAME }}