From c095c12d20a9333b74d1dc2700ba7f0f723b1b7b Mon Sep 17 00:00:00 2001 From: Mark Khazin Date: Wed, 25 May 2022 11:05:38 +0300 Subject: [PATCH] replace travis-ci with github actions --- .github/workflows/create-release.yml | 40 ++++++++++++++++++++++++++++ .github/workflows/run-tests.yml | 21 +++++++++++++++ .gitignore | 2 +- .travis.yml | 10 ------- 4 files changed, 62 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/create-release.yml create mode 100644 .github/workflows/run-tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..7623293 --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,40 @@ +name: Maven Package + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + - name: Build with Maven + run: mvn -B package --file pom.xml + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false + - name: Upload Release Asset + 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: ./target/releases/analysis-homoglyph-0.2.3.zip + asset_name: analysis-homoglyph-0.2.3.zip + asset_content_type: application/zip diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..5cb0542 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,21 @@ +name: Maven Tests + +on: + push: + pull_requests: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + - name: Test with Maven + run: mvn -B test --file pom.xml diff --git a/.gitignore b/.gitignore index a231f01..cc1fbae 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,4 @@ buildNumber.properties .settings/ .idea -*.iml \ No newline at end of file +*.iml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 33c56a5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: java -deploy: - provider: releases - api_key: $GITHUB_API_KEY - skip_cleanup: true - file: target/releases/analysis-homoglyph-0.2.2.zip - on: - tags: true -script: -- mvn package