Skip to content

updated address of apple LATAM subsidiary #59

updated address of apple LATAM subsidiary

updated address of apple LATAM subsidiary #59

name: Build
on:
[push]
env:
APP_NAME: reverseCharger
jobs:
build:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" #This check is case insensitive
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Use a numerical verison for jpackage
shell: pwsh
run: |
$numVer = (mvn help:evaluate '-Dexpression=project.version' '-q' '-DforceStdout') -replace '(\d{1,3}\.\d{1,3}\.\d{1,3})(.*)' ,'$1'
mvn versions:set --file pom.xml "-DnewVersion=${numVer}"
- name: Extract version from tag and set it as project version
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
mvn versions:set --file pom.xml -DnewVersion=${GITHUB_REF##*/}
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Uploads the build artifact
uses: actions/upload-artifact@v2
with:
name: ${{env.APP_NAME}}-${{runner.os}}.zip
path: target/reverseCharger-*.zip
release:
name: Draft a Release on GitHub Releases
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
env:
BUILD_VERSION: DUMMY
steps:
- name: Get version from tag and set up environment
run: echo "BUILD_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Download all artifacts
uses: actions/download-artifact@v2
- 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 }}
body: |
:construction: Work in Progress
draft: true
prerelease: false
- name: Upload linux package to release draft
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.APP_NAME }}-Linux.zip/reverseCharger-${{ env.BUILD_VERSION }}-linux.zip
asset_name: ${{ env.APP_NAME }}-${{ env.BUILD_VERSION }}-linux.zip
asset_content_type: application/gzip
- name: Upload windows artifact to release draft
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.APP_NAME }}-Windows.zip/reverseCharger-${{ env.BUILD_VERSION }}-win.zip
asset_name: ${{ env.APP_NAME }}-${{ env.BUILD_VERSION }}-win.zip
asset_content_type: application/zip
- name: Upload mac artifact to release draft
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.APP_NAME }}-macOS.zip/reverseCharger-${{ env.BUILD_VERSION }}-mac.zip
asset_name: ${{ env.APP_NAME }}-${{ env.BUILD_VERSION }}-mac.zip
asset_content_type: application/zip