ci: tar downloaded folders #11
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: CI/CD Pipeline | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: cli-utils on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '17' | |
distribution: 'graalvm' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
native-image-job-reports: 'true' | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: nativeCompile | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cli-utils-${{ matrix.os }} | |
path: ${{ github.workspace }}/**/build/native/nativeCompile/* | |
if-no-files-found: error | |
tag: | |
name: Create tag and Release | |
needs: [build] | |
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Bump version and push tag | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/download-artifact@v3 | |
with: | |
path: bin | |
- name: Display structure of downloaded files | |
run: ls -alR | |
working-directory: bin/ | |
- name: Compress files | |
run: ./tar-folders.sh bin | |
# - name: Publish Release | |
# uses: ncipollo/release-action@v1 | |
# with: | |
# artifacts: "bin/cli-utils-*" | |
# tag: ${{ steps.tag_version.outputs.new_tag }} | |
# name: Release ${{ steps.tag_version.outputs.new_tag }} | |
# body: ${{ steps.tag_version.outputs.changelog }} |