Skip to content

Commit

Permalink
Merge pull request #7 from AntaresSimulatorTeam/fix/nodejs
Browse files Browse the repository at this point in the history
Remove deprecated actions
  • Loading branch information
flomnes authored Jul 17, 2024
2 parents 65b354a + e19be85 commit 9bdef47
Showing 1 changed file with 33 additions and 38 deletions.
71 changes: 33 additions & 38 deletions .github/workflows/generate-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,38 @@ on:
required: true
antares_tag:
description: "Antares_Simulator solver tag"
default: v8.0.3
default: v9.0.0
required: true
antares_tests_tag:
description: "Antares_Simulator_Tests_NR"
default: v8.0.0
default: v9.0.0
required: true

jobs:
release:
runs-on: ubuntu-latest
outputs:
url: ${{ steps.create_release.outputs.upload_url }}
batches: ${{ steps.read_batches.outputs.batches }}

steps:
- name: Release creation
uses: actions/create-release@v1
id: create_release
- name: Checkout SimTest
uses: actions/checkout@v4

- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.release_tag }}
release_name: ${{ github.event.inputs.release_name }}
body: |
Antares_Simulator : ${{ github.event.inputs.antares_tag }}
Antares_Simulator_Tests_NR : ${{ github.event.inputs.antares_tests_tag }}
matrix:
runs-on: ubuntu-latest
needs: release
outputs:
batches: ${{ steps.read_batches.outputs.batches }}
tag: ${{ github.event.inputs.release_tag }}
title: ${{ github.event.inputs.release_name }}
antares_tag: ${{ github.event.inputs.antares_tag }}
antares_tests_tag: ${{ github.event.inputs.antares_tests_tag }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="$title" \
--target="$target_branch" \
--notes="Antares_Simulator: $antares_tag
Antares_Simulator_Tests_NR: $antares_tests_tag"
steps:
- name: Download study-batches.txt
run: |
wget https://github.com/AntaresSimulatorTeam/Antares_Simulator_Tests_NR/releases/download/${{ github.event.inputs.antares_tests_tag }}/study-batches.txt
Expand All @@ -52,30 +52,27 @@ jobs:
id: read_batches
run: |
BATCHES=$(printf "\"%s\"," $(cat study-batches.txt) | sed "s/^/[/;s/,$/]/")
echo "::set-output name=batches::$BATCHES"
echo "batches=$BATCHES" >> $GITHUB_OUTPUT
- name: Upload study-batches.txt
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.release.outputs.url }}
asset_path: study-batches.txt
asset_name: study-batches.txt
asset_content_type: application/octet-stream
tag: ${{ github.event.inputs.release_tag }}
run: |
gh release upload "$tag" study-batches.txt
generation:
runs-on: ${{ matrix.os }}
needs: [release, matrix]
needs: release
strategy:
fail-fast: false
matrix:
batch: ${{ fromJson(needs.matrix.outputs.batches) }}
batch: ${{ fromJson(needs.release.outputs.batches) }}
os: [ubuntu-20.04, windows-2022]

steps:
- name: Checkout SimTest
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Pre-requisites (Windows)
if: ${{ startsWith(matrix.os, 'windows') }}
Expand Down Expand Up @@ -130,19 +127,17 @@ jobs:
- name: Write tags to file
shell: bash
run: |
echo Antares_Simulator ${{ github.event.inputs.antares_tag }} >> ${{ matrix.batch }}/version.txt
echo Antares_Simulator_Tests_NR ${{ github.event.inputs.antares_tests_tag }} >> ${{ matrix.batch }}/version.txt
echo Antares_Simulator ${{ github.event.inputs.antares_tag }} >> ${{ matrix.batch }}/version.txt echo Antares_Simulator_Tests_NR ${{ github.event.inputs.antares_tests_tag }} >> ${{ matrix.batch }}/version.txt
echo SimTest ${{ github.event.inputs.release_tag }} >> ${{ matrix.batch }}/version.txt
- name: zip results
run: zip -q -r results.zip ${{ matrix.batch }}
run: zip -q -r ${{ matrix.batch }}-${{ matrix.os }}.zip ${{ matrix.batch }}

- name: Upload .zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.release.outputs.url }}
asset_path: results.zip
asset_name: ${{ matrix.batch }}-${{ matrix.os }}.zip
asset_content_type: application/octet-stream
tag: ${{ github.event.inputs.release_tag }}
shell: bash
run: |
gh release upload "$tag" ${{ matrix.batch }}-${{ matrix.os }}.zip

0 comments on commit 9bdef47

Please sign in to comment.