Skip to content

Commit

Permalink
Configure fork CI
Browse files Browse the repository at this point in the history
  • Loading branch information
asafadar committed Nov 13, 2024
1 parent 9e7a63b commit b44ead5
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 82 deletions.
69 changes: 35 additions & 34 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
name: Gradle Build

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get Fetch Tags
run: git -c protocol.version=2 fetch --tags --progress --no-recurse-submodules origin
if: "!contains(github.ref, 'refs/tags')"
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Get Release Version
id: get_version
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo ::set-output name=VERSION::$VERSION
- name: Upload artifact zip
uses: actions/[email protected]
with:
# Artifact name
name: kubernetes-${{ steps.get_version.outputs.VERSION }}
# Directory containing files to upload
path: build/libs/kubernetes-${{ steps.get_version.outputs.VERSION }}.zip
#name: Gradle Build
#
#on: [push]
#
#jobs:
# build:
#
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Get Fetch Tags
# run: git -c protocol.version=2 fetch --tags --progress --no-recurse-submodules origin
# if: "!contains(github.ref, 'refs/tags')"
# - name: Set up JDK 1.8
# uses: actions/setup-java@v3
# with:
# distribution: 'corretto'
# java-version: 8
# - name: Grant execute permission for gradlew
# run: chmod +x gradlew
# - name: Build with Gradle
# run: ./gradlew build
# - name: Get Release Version
# id: get_version
# run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo VERSION=$VERSION >> $GITHUB_OUTPUT
# - name: Upload artifact zip
# uses: actions/[email protected]
# with:
# # Artifact name
# name: kubernetes-${{ steps.get_version.outputs.VERSION }}
# # Directory containing files to upload
# path: build/libs/kubernetes-${{ steps.get_version.outputs.VERSION }}.zip
38 changes: 38 additions & 0 deletions .github/workflows/hunters_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
push:
tags:
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10
branches:
- feat/delete-flink-application

name: Create Release

jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew build
- name: Get Release Version
id: get_version
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet)-$(git rev-parse --short "$GITHUB_SHA") && echo ::set-output name=VERSION::$VERSION
- name: Test
run: chmod +x ls -la build/libs/${{ steps.get_version.outputs.VERSION }}.zip;
- name: Upload Release Zip
id: upload_release_asset
uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: rundeck-plugins
source_dir: build/libs/${{ steps.get_version.outputs.VERSION }}.zip
destination_dir: python
94 changes: 47 additions & 47 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Create Release

jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew build
- name: Get Release Version
id: get_version
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo ::set-output name=VERSION::$VERSION
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false
- name: Upload Release Zip
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/libs/kubernetes-${{ steps.get_version.outputs.VERSION }}.zip
asset_name: kubernetes-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/octet-stream

#on:
# push:
# # Sequence of patterns matched against refs/tags
# tags:
# - '*' # Push events to matching v*, i.e. v1.0, v20.15.10
#
#name: Create Release
#
#jobs:
# build:
# name: Upload Release Asset
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: set up JDK 1.8
# uses: actions/setup-java@v1
# with:
# java-version: 1.8
# - name: Build with Gradle
# run: ./gradlew build
# - name: Get Release Version
# id: get_version
# run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo ::set-output name=VERSION::$VERSION
# - name: Create Release
# id: create_release
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ steps.get_version.outputs.VERSION }}
# draft: false
# prerelease: false
# - name: Upload Release Zip
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: build/libs/kubernetes-${{ steps.get_version.outputs.VERSION }}.zip
# asset_name: kubernetes-${{ steps.get_version.outputs.VERSION }}.zip
# asset_content_type: application/octet-stream
#
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ scmVersion {
}
}

project.version = scmVersion.version
def gitHash = 'git rev-parse --short HEAD'.execute().text.trim()

project.version = "${scmVersion.version}-${gitHash}"
ext.archiveFilename = ext.archivesBaseName + '-' + version

apply from: 'https://raw.githubusercontent.com/rundeck-plugins/build-zip/gradle-5.6/build.gradle'

0 comments on commit b44ead5

Please sign in to comment.