From 38614e6c6f43a49965fc0ef705c91e78d8dbd6f8 Mon Sep 17 00:00:00 2001 From: arcuri82 Date: Wed, 11 Oct 2023 09:45:42 +0200 Subject: [PATCH] trying to improve automation of release --- .github/workflows/ci.yml | 5 +- .github/workflows/release.yml | 152 ++++++++++++++++++++++++++++++++++ version.py | 1 + 3 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 466147f8f3..65f6de1d31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,9 @@ name: CI -on: [push] +on: + push: + tags-ignore: + - '**' env: evomaster-version: 1.6.2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..42ef0b857c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,152 @@ +name: Release on GitHub + +on: + push: + tags: + - "v*" + +env: + evomaster-version: 1.6.2 + jdk: 17 + retention-days: 1 + + + +jobs: + + build-base: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup JDK ${{env.jdk}} + uses: actions/setup-java@v1 + with: + java-version: ${{env.jdk}} + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build with Maven + run: mvn clean verify -DskipTests + env: + CI_env: GithubAction + - name: Upload evomaster.jar + uses: actions/upload-artifact@v2 + with: + name: evomaster.jar + path: core/target/evomaster.jar + retention-days: ${{env.retention-days}} + if-no-files-found: error + + installer-for-windows: + needs: build-base + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Setup JDK ${{env.jdk}} + uses: actions/setup-java@v1 + with: + java-version: ${{env.jdk}} + - name: Download fat jar + uses: actions/download-artifact@v2 + with: + name: evomaster.jar + path: core/target + - name: Build installation file + shell: bash + run: bash makeExecutable.sh WINDOWS + - name: Upload installation file + uses: actions/upload-artifact@v2 + with: + name: evomaster.msi + path: release/evomaster-${{env.evomaster-version}}.msi + retention-days: ${{env.retention-days}} + if-no-files-found: error + + installer-for-osx: + needs: build-base + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Setup JDK ${{env.jdk}} + uses: actions/setup-java@v1 + with: + java-version: ${{env.jdk}} + - name: Download fat jar + uses: actions/download-artifact@v2 + with: + name: evomaster.jar + path: core/target + - name: Build installation file + shell: bash + run: bash makeExecutable.sh OSX + - name: Upload installation file + uses: actions/upload-artifact@v2 + with: + name: evomaster.dmg + path: release/evomaster-${{env.evomaster-version}}.dmg + retention-days: ${{env.retention-days}} + if-no-files-found: error + + installer-for-debian: + needs: build-base + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup JDK ${{env.jdk}} + uses: actions/setup-java@v1 + with: + java-version: ${{env.jdk}} + - name: Download fat jar + uses: actions/download-artifact@v2 + with: + name: evomaster.jar + path: core/target + - name: Build installation file + shell: bash + run: bash makeExecutable.sh DEBIAN + - name: Upload installation file + uses: actions/upload-artifact@v2 + with: + name: evomaster.deb + path: release/evomaster_${{env.evomaster-version}}-1_amd64.deb + retention-days: ${{env.retention-days}} + if-no-files-found: error + + tagged-release: + needs: [installer-for-debian,installer-for-windows,installer-for-osx] + name: "Tagged Release" + runs-on: "ubuntu-latest" + + steps: + + - name: Download fat jar + uses: actions/download-artifact@v2 + with: + name: evomaster.jar + - name: Download + uses: actions/download-artifact@v2 + with: + name: evomaster.deb + - name: Download + uses: actions/download-artifact@v2 + with: + name: evomaster.dmg + - name: Download + uses: actions/download-artifact@v2 + with: + name: evomaster.msi + + + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + evomaster.jar + evomaster.deb + evomaster.dmg + evomaster.msi + diff --git a/version.py b/version.py index b63b2b8372..2fbe6de516 100644 --- a/version.py +++ b/version.py @@ -50,6 +50,7 @@ def replaceInCI(): regex = re.compile(r' evomaster-version:.*') replacement = ' evomaster-version: '+reducedVersion+'\n' replace(".github/workflows/ci.yml", regex, replacement) + replace(".github/workflows/release.yml", regex, replacement) def replaceInJS(): regex = re.compile(r'\s*"version"\s*:.*')