Update CI
This commit is contained in:
135
.github/workflows/ci.yml
vendored
135
.github/workflows/ci.yml
vendored
@@ -27,15 +27,15 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os-name: [ ubuntu-latest, ubuntu-18.04, macOS-latest, windows-latest ]
|
os-name: [ ubuntu-latest, ubuntu-18.04, macOS-latest, windows-latest ]
|
||||||
python-version: [ 3.8 ]
|
python-version: [ 3.9 ]
|
||||||
# needs: [ install-test ]
|
# needs: [ install-test ]
|
||||||
steps:
|
steps:
|
||||||
# checkout commit
|
# checkout commit
|
||||||
- name: Checkout commit
|
- name: Checkout commit
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v2
|
||||||
# install python
|
# install python
|
||||||
- name: Install python
|
- name: Install python
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
architecture: "x64"
|
architecture: "x64"
|
||||||
@@ -48,6 +48,28 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python ./resources/ci/common/install.py
|
python ./resources/ci/common/install.py
|
||||||
pip install pyinstaller
|
pip install pyinstaller
|
||||||
|
# get parent directory
|
||||||
|
- name: Get Repo Name
|
||||||
|
uses: mad9000/actions-find-and-replace-string@1
|
||||||
|
id: repoName
|
||||||
|
with:
|
||||||
|
source: ${{ github.repository }}
|
||||||
|
find: '${{ github.repository_owner }}/'
|
||||||
|
replace: ''
|
||||||
|
- name: Get Parent Directory Path (!Windows)
|
||||||
|
uses: mad9000/actions-find-and-replace-string@1
|
||||||
|
id: parentDirNotWin
|
||||||
|
with:
|
||||||
|
source: ${{ github.workspace }}
|
||||||
|
find: '${{ steps.repoName.outputs.value }}/${{ steps.repoName.outputs.value }}'
|
||||||
|
replace: ${{ steps.repoName.outputs.value }}
|
||||||
|
- name: Get Parent Directory Path (Windows)
|
||||||
|
uses: mad9000/actions-find-and-replace-string@1
|
||||||
|
id: parentDir
|
||||||
|
with:
|
||||||
|
source: ${{ steps.parentDirNotWin.outputs.value }}
|
||||||
|
find: '${{ steps.repoName.outputs.value }}\${{ steps.repoName.outputs.value }}'
|
||||||
|
replace: ${{ steps.repoName.outputs.value }}
|
||||||
# try to get UPX
|
# try to get UPX
|
||||||
- name: Get UPX
|
- name: Get UPX
|
||||||
env:
|
env:
|
||||||
@@ -70,10 +92,10 @@ jobs:
|
|||||||
python ./resources/ci/common/prepare_binary.py
|
python ./resources/ci/common/prepare_binary.py
|
||||||
# upload binary artifacts for later step
|
# upload binary artifacts for later step
|
||||||
- name: Upload Binary Artifacts
|
- name: Upload Binary Artifacts
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: binaries-${{ matrix.os-name }}
|
name: binaries-${{ matrix.os-name }}
|
||||||
path: ../artifact
|
path: ${{ steps.parentDir.outputs.value }}/artifact
|
||||||
|
|
||||||
# Install & Preparing Release
|
# Install & Preparing Release
|
||||||
# Set up environment
|
# Set up environment
|
||||||
@@ -87,18 +109,18 @@ jobs:
|
|||||||
# os & python versions
|
# os & python versions
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
# install/release on not xenial
|
# install/release on not bionic
|
||||||
os-name: [ ubuntu-latest, ubuntu-18.04, macOS-latest, windows-latest ]
|
os-name: [ ubuntu-latest, ubuntu-18.04, macOS-latest, windows-latest ]
|
||||||
python-version: [ 3.8 ]
|
python-version: [ 3.9 ]
|
||||||
|
|
||||||
needs: [ install-build ]
|
needs: [ install-build ]
|
||||||
steps:
|
steps:
|
||||||
# checkout commit
|
# checkout commit
|
||||||
- name: Checkout commit
|
- name: Checkout commit
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v2
|
||||||
# install python
|
# install python
|
||||||
- name: Install Python
|
- name: Install Python
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
architecture: "x64"
|
architecture: "x64"
|
||||||
@@ -110,9 +132,31 @@ jobs:
|
|||||||
OS_NAME: ${{ matrix.os-name }}
|
OS_NAME: ${{ matrix.os-name }}
|
||||||
run: |
|
run: |
|
||||||
python ./resources/ci/common/install.py
|
python ./resources/ci/common/install.py
|
||||||
|
# get parent directory
|
||||||
|
- name: Get Repo Name
|
||||||
|
uses: mad9000/actions-find-and-replace-string@1
|
||||||
|
id: repoName
|
||||||
|
with:
|
||||||
|
source: ${{ github.repository }}
|
||||||
|
find: '${{ github.repository_owner }}/'
|
||||||
|
replace: ''
|
||||||
|
- name: Get Parent Directory Path (!Windows)
|
||||||
|
uses: mad9000/actions-find-and-replace-string@1
|
||||||
|
id: parentDirNotWin
|
||||||
|
with:
|
||||||
|
source: ${{ github.workspace }}
|
||||||
|
find: '${{ steps.repoName.outputs.value }}/${{ steps.repoName.outputs.value }}'
|
||||||
|
replace: ${{ steps.repoName.outputs.value }}
|
||||||
|
- name: Get Parent Directory Path (Windows)
|
||||||
|
uses: mad9000/actions-find-and-replace-string@1
|
||||||
|
id: parentDir
|
||||||
|
with:
|
||||||
|
source: ${{ steps.parentDirNotWin.outputs.value }}
|
||||||
|
find: '${{ steps.repoName.outputs.value }}\${{ steps.repoName.outputs.value }}'
|
||||||
|
replace: ${{ steps.repoName.outputs.value }}
|
||||||
# download binary artifact
|
# download binary artifact
|
||||||
- name: Download Binary Artifact
|
- name: Download Binary Artifact
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: binaries-${{ matrix.os-name }}
|
name: binaries-${{ matrix.os-name }}
|
||||||
path: ./
|
path: ./
|
||||||
@@ -126,22 +170,22 @@ jobs:
|
|||||||
python ./resources/ci/common/prepare_release.py
|
python ./resources/ci/common/prepare_release.py
|
||||||
# upload appversion artifact for later step
|
# upload appversion artifact for later step
|
||||||
- name: Upload AppVersion Artifact
|
- name: Upload AppVersion Artifact
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: appversion-${{ matrix.os-name }}
|
name: appversion-${{ matrix.os-name }}
|
||||||
path: ./resources/app/meta/manifests/app_version.txt
|
path: ./resources/app/meta/manifests/app_version.txt
|
||||||
# upload archive artifact for later step
|
# upload archive artifact for later step
|
||||||
- name: Upload Archive Artifact
|
- name: Upload Archive Artifact
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: archive-${{ matrix.os-name }}
|
name: archive-${{ matrix.os-name }}
|
||||||
path: ../deploy
|
path: ${{ steps.parentDir.outputs.value }}/deploy
|
||||||
|
|
||||||
# Deploy to GitHub Releases
|
# Deploy to GitHub Releases
|
||||||
# Release Name: ALttPDoorRandomizer v${GITHUB_TAG}
|
# Release Name: ALttPDoorRandomizer v${GITHUB_TAG}
|
||||||
# Release Body: Inline content of RELEASENOTES.md
|
# Release Body: Inline content of RELEASENOTES.md
|
||||||
# Release Body: Fallback to URL to RELEASENOTES.md
|
# Release Body: Fallback to URL to RELEASENOTES.md
|
||||||
# Release Files: ../deploy
|
# Release Files: ${{ steps.parentDir.outputs.value }}/deploy
|
||||||
deploy-release:
|
deploy-release:
|
||||||
name: Deploy GHReleases
|
name: Deploy GHReleases
|
||||||
runs-on: ${{ matrix.os-name }}
|
runs-on: ${{ matrix.os-name }}
|
||||||
@@ -150,42 +194,64 @@ jobs:
|
|||||||
# os & python versions
|
# os & python versions
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
# release only on focal/bionic
|
# release only on focal
|
||||||
os-name: [ ubuntu-latest ]
|
os-name: [ ubuntu-latest ]
|
||||||
python-version: [ 3.8 ]
|
python-version: [ 3.9 ]
|
||||||
|
|
||||||
needs: [ install-prepare-release ]
|
needs: [ install-prepare-release ]
|
||||||
steps:
|
steps:
|
||||||
# checkout commit
|
# checkout commit
|
||||||
- name: Checkout commit
|
- name: Checkout commit
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v2
|
||||||
|
# get parent directory
|
||||||
|
- name: Get Repo Name
|
||||||
|
uses: mad9000/actions-find-and-replace-string@1
|
||||||
|
id: repoName
|
||||||
|
with:
|
||||||
|
source: ${{ github.repository }}
|
||||||
|
find: '${{ github.repository_owner }}/'
|
||||||
|
replace: ''
|
||||||
|
- name: Get Parent Directory Path (!Windows)
|
||||||
|
uses: mad9000/actions-find-and-replace-string@1
|
||||||
|
id: parentDirNotWin
|
||||||
|
with:
|
||||||
|
source: ${{ github.workspace }}
|
||||||
|
find: '${{ steps.repoName.outputs.value }}/${{ steps.repoName.outputs.value }}'
|
||||||
|
replace: ${{ steps.repoName.outputs.value }}
|
||||||
|
- name: Get Parent Directory Path (Windows)
|
||||||
|
uses: mad9000/actions-find-and-replace-string@1
|
||||||
|
id: parentDir
|
||||||
|
with:
|
||||||
|
source: ${{ steps.parentDirNotWin.outputs.value }}
|
||||||
|
find: '${{ steps.repoName.outputs.value }}\${{ steps.repoName.outputs.value }}'
|
||||||
|
replace: ${{ steps.repoName.outputs.value }}
|
||||||
- name: Install Dependencies via pip
|
- name: Install Dependencies via pip
|
||||||
run: |
|
run: |
|
||||||
python -m pip install pytz requests
|
python -m pip install pytz requests
|
||||||
# download appversion artifact
|
# download appversion artifact
|
||||||
- name: Download AppVersion Artifact
|
- name: Download AppVersion Artifact
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: appversion-${{ matrix.os-name }}
|
name: appversion-${{ matrix.os-name }}
|
||||||
path: ../build
|
path: ${{ steps.parentDir.outputs.value }}/build
|
||||||
# download ubuntu archive artifact
|
# download ubuntu archive artifact
|
||||||
- name: Download Ubuntu Archive Artifact
|
- name: Download Ubuntu Archive Artifact
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: archive-ubuntu-latest
|
name: archive-ubuntu-latest
|
||||||
path: ../deploy/linux
|
path: ${{ steps.parentDir.outputs.value }}/deploy/linux
|
||||||
# download macos archive artifact
|
# download macos archive artifact
|
||||||
- name: Download MacOS Archive Artifact
|
- name: Download MacOS Archive Artifact
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: archive-macOS-latest
|
name: archive-macOS-latest
|
||||||
path: ../deploy/macos
|
path: ${{ steps.parentDir.outputs.value }}/deploy/macos
|
||||||
# download windows archive artifact
|
# download windows archive artifact
|
||||||
- name: Download Windows Archive Artifact
|
- name: Download Windows Archive Artifact
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: archive-windows-latest
|
name: archive-windows-latest
|
||||||
path: ../deploy/windows
|
path: ${{ steps.parentDir.outputs.value }}/deploy/windows
|
||||||
# debug info
|
# debug info
|
||||||
- name: Debug Info
|
- name: Debug Info
|
||||||
id: debug_info
|
id: debug_info
|
||||||
@@ -199,32 +265,23 @@ jobs:
|
|||||||
RELEASE_NAME="ALttPDoorRandomizer ${GITHUB_TAG}"
|
RELEASE_NAME="ALttPDoorRandomizer ${GITHUB_TAG}"
|
||||||
echo "Release Name: ${RELEASE_NAME}"
|
echo "Release Name: ${RELEASE_NAME}"
|
||||||
echo "Git Tag: ${GITHUB_TAG}"
|
echo "Git Tag: ${GITHUB_TAG}"
|
||||||
# read releasenotes
|
|
||||||
- name: Read RELEASENOTES
|
|
||||||
id: release_notes
|
|
||||||
run: |
|
|
||||||
body="$(cat RELEASENOTES.md)"
|
|
||||||
body="${body//'%'/'%25'}"
|
|
||||||
body="${body//$'\n'/'%0A'}"
|
|
||||||
body="${body//$'\r'/'%0D'}"
|
|
||||||
echo "::set-output name=body::$body"
|
|
||||||
# create a pre/release
|
# create a pre/release
|
||||||
- name: Create a Pre/Release
|
- name: Create a Pre/Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@master
|
uses: actions/create-release@v1.1.4
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
tag_name: v${{ steps.debug_info.outputs.github_tag }}
|
tag_name: v${{ steps.debug_info.outputs.github_tag }}
|
||||||
release_name: ALttPDoorRandomizer v${{ steps.debug_info.outputs.github_tag }}
|
release_name: ALttPDoorRandomizer v${{ steps.debug_info.outputs.github_tag }}
|
||||||
body: ${{ steps.release_notes.outputs.body }}
|
body_path: RELEASENOTES.md
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
if: contains(github.ref, 'master') || contains(github.ref, 'stable') || contains(github.ref, 'dev') || contains(github.ref, 'DoorRelease')
|
if: contains(github.ref, 'master') || contains(github.ref, 'stable') || contains(github.ref, 'dev') || contains(github.ref, 'DoorRelease')
|
||||||
# upload linux archive asset
|
# upload linux archive asset
|
||||||
- name: Upload Linux Archive Asset
|
- name: Upload Linux Archive Asset
|
||||||
id: upload-linux-asset
|
id: upload-linux-asset
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
@@ -236,7 +293,7 @@ jobs:
|
|||||||
# upload macos archive asset
|
# upload macos archive asset
|
||||||
- name: Upload MacOS Archive Asset
|
- name: Upload MacOS Archive Asset
|
||||||
id: upload-macos-asset
|
id: upload-macos-asset
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
@@ -248,7 +305,7 @@ jobs:
|
|||||||
# upload windows archive asset
|
# upload windows archive asset
|
||||||
- name: Upload Windows Archive Asset
|
- name: Upload Windows Archive Asset
|
||||||
id: upload-windows-asset
|
id: upload-windows-asset
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user