Skip to content

Commit

Permalink
Update upload asset to release: remove deprecated action (#685)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonMarechal25 authored Sep 14, 2023
1 parent c67070f commit 175c4c9
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-userguide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Get release
if: github.event_name == 'release' && github.event.action == 'created'
id: get_release
uses: bruceadams/get-release@v1.2.3
uses: bruceadams/get-release@main

- name: Read antares-xpansion version
id: antares-xpansion-version
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ jobs:
os: centos7
os-full-name: CentOS-7.9.2009
#variant: -ortools-xpress

- name: Compile Boost
uses: ./.github/workflows/compile-boost
with:
prefix: "../rte-antares-deps-Release/"
with:
prefix: "../rte-antares-deps-Release/"

- name: Install dependencies
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ jobs:
antares-version: ${{steps.antares-version.outputs.result}}
os: ${{matrix.os}}
os-full-name: Ubuntu-20.04

- name: Compile Boost
uses: ./.github/workflows/compile-boost
with:
with:
prefix: "../rte-antares-deps-Release/"

- name: Configure
shell: bash
#XPRESS_VALUE = ${{ matrix.xprs }} == "XPRESS-ON" ? "ON" : "OFF"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Centos7 CI (bare docker image)
name: Centos7 release

on:
push:
Expand All @@ -16,9 +16,7 @@ env:
jobs:

docker_publish:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@master
Expand Down Expand Up @@ -116,7 +114,9 @@ jobs:
XPRESSDIR_CONTAINER: ${GITHUB_WORKSPACE}/xpress
XPRESS_CONTAINER: ${GITHUB_WORKSPACE}/xpress/bin
XPRS_LIB_Path_CONTAINER: ${GITHUB_WORKSPACE}/xpress/lib

outputs:
zip_name: ${{ steps.zip_name.outputs.zip_name }}
singlefile_name: ${{ steps.zip_name.outputs.singlefile_name }}
steps:
- id: branch-name
uses: tj-actions/branch-names@v6
Expand All @@ -134,12 +134,12 @@ jobs:
os: centos7
os-full-name: CentOS-7.9.2009
#variant: -ortools-xpress

- name: Compile Boost
uses: ./.github/workflows/compile-boost
with:
with:
prefix: "../rte-antares-deps-Release/"

- name: Install dependencies
run: |
pip3 install -r requirements-tests.txt
Expand Down Expand Up @@ -191,6 +191,17 @@ jobs:
export PATH=/usr/lib64/openmpi/bin:$PATH
cmake3 --build _build --config Release -j2 --target install
- name: Running unit tests
timeout-minutes: 120
shell: bash
run: |
source /etc/profile.d/modules.sh
module load mpi
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:${{ env.XPRS_LIB_Path_CONTAINER }}
export XPRESS=${{ env.XPRESS_CONTAINER }}
cd _build
ctest3 -C Release --output-on-failure -L "unit|benders|lpnamer|medium"
- name: set name variables
id: single_file_name
shell: bash
Expand All @@ -210,76 +221,61 @@ jobs:
cpack3 -G TGZ -D CPACK_PACKAGE_FILE_NAME=$FILE_NAME
echo "TGZ_NAME=$FILE_NAME.tar.gz" >> $GITHUB_ENV
- name: Installer .rpm creation
run: |
cd _build
export FILE_NAME="antaresXpansion-${{env.VERSION_WITH_XPRESS}}-CentOS-7.9.2009"
cpack3 -G RPM -D CPACK_PACKAGE_FILE_NAME=$FILE_NAME -D CPACK_OUTPUT_FILE_NAME=$FILE_NAME.rpm
echo "RPM_NAME=$FILE_NAME.rpm" >> $GITHUB_ENV
- id: create-single-file
name: Single file .tar.gz creation
uses: ./.github/workflows/single-file-creation-tgz
with:
antares-xpansion-version: ${{env.VERSION_WITH_XPRESS}}

- name: Upload .tar.gz
uses: actions/upload-artifact@v3
with:
name: ${{env.TGZ_NAME}}
path: _build/${{env.TGZ_NAME}}

- name: Upload rpm
uses: actions/upload-artifact@v3
- id: create-single-file
name: Single file .tar.gz creation
uses: ./.github/workflows/single-file-creation-tgz
with:
name: ${{env.RPM_NAME}}
path: _build/${{env.RPM_NAME}}
antares-xpansion-version: ${{env.VERSION_WITH_XPRESS}}

- name: Upload single file
uses: actions/upload-artifact@v3
with:
name: ${{ steps.create-single-file.outputs.archive-name }}
path: ${{ steps.create-single-file.outputs.archive-path }}

- name: Running unit tests
timeout-minutes: 120
shell: bash
- id: zip_name
run: |
source /etc/profile.d/modules.sh
module load mpi
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:${{ env.XPRS_LIB_Path_CONTAINER }}
export XPRESS=${{ env.XPRESS_CONTAINER }}
cd _build
ctest3 -C Release --output-on-failure -L "unit|benders|lpnamer|medium"
echo "singlefile_name=${{steps.create-single-file.outputs.archive-name}}" >> "$GITHUB_OUTPUT"
echo "zip_name=${{env.TGZ_NAME}}" >> "$GITHUB_OUTPUT"
#######################

upload_asset_to_release:
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
needs: build
env:
ZIP_NAME: ${{needs.build.outputs.zip_name}}
SINGLEFILE_NAME: ${{needs.build.outputs.singlefile_name}}
steps:
- name: Get release
if: github.event_name == 'release' && github.event.action == 'created'
id: get_release
uses: bruceadams/get-release@v1.2.3
uses: bruceadams/get-release@main

- name: Publish .tar.gz
if: github.event_name == 'release' && github.event.action == 'created'
uses: actions/[email protected]
- name: Download Artifact
uses: actions/download-artifact@v3
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: _build/${{env.TGZ_NAME}}
asset_name: ${{env.TGZ_NAME}}
asset_content_type: application/octet-stream
name: $ZIP_NAME
path: .

- name: Publish .rpm
if: github.event_name == 'release' && github.event.action == 'created'
uses: actions/[email protected]
- name: Download Artifact
uses: actions/download-artifact@v3
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: _build/${{env.RPM_NAME}}
asset_name: ${{env.RPM_NAME}}
asset_content_type: application/octet-stream
name: $SINGLEFILE_NAME
path: .

- name: Publish single file
if: github.event_name == 'release' && github.event.action == 'created'
uses: actions/[email protected]
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ steps.create-single-file.outputs.archive-path }}
asset_name: ${{ steps.create-single-file.outputs.archive-name }}
asset_content_type: application/octet-stream
- name: Upload Release Asset
env:
GH_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload --repo ${{env.GH_REPO}} ${{ steps.get_release.outputs.tag_name }} $ZIP_NAME
gh release upload --repo ${{env.GH_REPO}} ${{ steps.get_release.outputs.tag_name }} $SINGLEFILE_NAME
########################
10 changes: 5 additions & 5 deletions .github/workflows/centos7-system-deps-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ jobs:
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b ${{ steps.branch-name.outputs.current_branch }} .
git submodule update --init
- name: Install dependencies
run: |
pip3 install -r requirements-tests.txt
pip3 install -r requirements-ui.txt
- name: Compile Boost
uses: ./.github/workflows/compile-boost
with:
with:
prefix: "../rte-antares-deps-Release/"

- name: Compile tbb
uses: ./.github/workflows/compile-tbb
uses: ./.github/workflows/compile-tbb

- name: Configure
run: |
source /opt/rh/devtoolset-9/enable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ubuntu CI
name: Ubuntu Release

on:
push:
Expand Down Expand Up @@ -186,65 +186,37 @@ jobs:
#Cpack command line doesn't seem to care about -P or -R options
echo "TGZ_NAME=$FILE_NAME.tar.gz" >> $GITHUB_ENV
- name: Installer .deb creation
- name: Running unit tests
run: |
cd _build
export FILE_NAME="antaresXpansion-${{env.VERSION_WITH_XPRESS}}-${{ matrix.os }}"
cpack -G DEB -D CPACK_PACKAGE_FILE_NAME=$FILE_NAME
echo "DEB_NAME=$FILE_NAME.deb" >> $GITHUB_ENV
ctest -C Release --output-on-failure -L "medium|unit|benders|lpnamer"
#Uploads are not necessary for release but useful in other cases
- name: Upload .tar.gz
uses: actions/upload-artifact@v3
with:
name: ${{env.TGZ_NAME}}
path: _build/${{env.TGZ_NAME}}

- name: Upload .deb
uses: actions/upload-artifact@v3
with:
name: ${{env.DEB_NAME}}
path: _build/${{env.DEB_NAME}}

- name: Upload single file
uses: actions/upload-artifact@v3
with:
name: ${{ steps.create-single-file.outputs.archive-name }}
path: ${{ steps.create-single-file.outputs.archive-path }}

- name: Running unit tests
run: |
cd _build
ctest -C Release --output-on-failure -L "medium|unit|benders|lpnamer"
#######################

- name: Get release
if: github.event_name == 'release' && github.event.action == 'created'
id: get_release
uses: bruceadams/get-release@v1.2.3
uses: bruceadams/get-release@main

- name: Publish .tar.gz
- name: Upload Release Asset
if: github.event_name == 'release' && github.event.action == 'created'
uses: actions/[email protected]
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: _build/${{env.TGZ_NAME}}
asset_name: ${{env.TGZ_NAME}}
asset_content_type: application/octet-stream

- name: Publish .deb
if: github.event_name == 'release' && github.event.action == 'created'
uses: actions/[email protected]
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: _build/${{env.DEB_NAME}}
asset_name: ${{env.DEB_NAME}}
asset_content_type: application/octet-stream

- name: Publish single file
if: github.event_name == 'release' && github.event.action == 'created'
uses: actions/[email protected]
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ steps.create-single-file.outputs.archive-path }}
asset_name: ${{ steps.create-single-file.outputs.archive-name }}
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ steps.get_release.outputs.tag_name }} _build/${{env.TGZ_NAME}}
gh release upload ${{ steps.get_release.outputs.tag_name }} _build/${{env.TGZ_NAME}}
########################
6 changes: 3 additions & 3 deletions .github/workflows/ubuntu-system-deps-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ jobs:
cd /usr/src/googletest/
sudo cmake .
sudo cmake --build . --target install
- name: Compile Boost
uses: ./.github/workflows/compile-boost
with:
with:
prefix: "../rte-antares-deps-Release/"


- name: Read antares-xpansion version
id: antares-xpansion-version
Expand Down
Loading

0 comments on commit 175c4c9

Please sign in to comment.