diff --git a/.actions/nwserver/download/action.yml b/.actions/nwserver/download/action.yml index 70f2203..ac5f1ca 100644 --- a/.actions/nwserver/download/action.yml +++ b/.actions/nwserver/download/action.yml @@ -29,7 +29,6 @@ runs: shell: bash env: APP_ID: 704450 - BUILD_ID: 11253735 WIN_BIN_DEPOT_ID: 704452 LINUX_BIN_DEPOT_ID: 704454 CONTENT_DEPOT_ID: 704451 @@ -37,7 +36,10 @@ runs: run: | mkdir -p ${{ inputs.output_path }}/nwserver/lang/en/data ${{ inputs.output_path }}/nwserver/data/bin/linux-amd64 ${{ inputs.output_path }}/nwserver/data/bin/linux-arm64 ${{ inputs.output_path }}/nwserver/data/data/mod/ cd DepotDownloader/DepotDownloader - dotnet run -app 704450 -depot 704452 -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }} - dotnet run -app 704450 -depot 704454 -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }} - dotnet run -app 704450 -depot 704451 -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }} - ls -la depots/704451/ + dotnet run -app 704450 -depot ${{ inputs.WIN_BIN_DEPOT_ID }} -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }} + dotnet run -app 704450 -depot ${{ inputs.LINUX_BIN_DEPOT_ID }} -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }} + dotnet run -app 704450 -depot ${{ inputs.CONTENT_DEPOT_ID }} -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }} + cd depots/${{ inputs.CONTENT_DEPOT_ID }}/*/ + cp bin/linux-x86/nwserver-linux ${{ inputs.output_path }}/nwserver/docker_data/data/bin/linux-amd64/nwserver + cp bin/win32/nwserver.exe ${{ inputs.output_path }}/nwserver.exe + cp bin/linux-arm64/nwserver-linux ${{ inputs.output_path }}/nwserver/docker_data/data/bin/linux-arm64/nwserver \ No newline at end of file diff --git a/.actions/nwserver/package/action.yml b/.actions/nwserver/package/action.yml index 92526f6..36fdea4 100644 --- a/.actions/nwserver/package/action.yml +++ b/.actions/nwserver/package/action.yml @@ -17,7 +17,6 @@ runs: shell: bash env: APP_ID: 704450 - BUILD_ID: 11253735 WIN_BIN_DEPOT_ID: 704452 LINUX_BIN_DEPOT_ID: 704454 CONTENT_DEPOT_ID: 704451 diff --git a/.actions/nwserver/parse/action.yml b/.actions/nwserver/parse/action.yml new file mode 100644 index 0000000..dd9afaf --- /dev/null +++ b/.actions/nwserver/parse/action.yml @@ -0,0 +1,29 @@ +name: "Parse nwserver" +inputs: + path: + description: "Path to nwserver.exe" + required: true + type: string + default: "nwserver/nwserver.exe" +outputs: + version: ${{ steps.nwn.outputs.version }} + major: ${{ steps.nwn.outputs.major }} + minor: ${{ steps.nwn.outputs.minor }} + patch: ${{ steps.nwn.outputs.patch }} +runs: + using: "composite" + steps: + - name: Install Dependencies + shell: bash + run: | + sudo apt install unzip pev + wget -O /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver + chmod +x /usr/local/bin/semver + - name: Parse nwnee files + id: nwn + shell: bash + run: | + echo version=$(peres -v nwserver.exe -f csv | grep -v DEBUG | cut -d'.' -f2- | sed -n 2p) >> $GITHUB_OUTPUT + echo major=$(semver get major $(peres -v nwserver.exe -f csv | grep -v DEBUG | cut -d'.' -f2- | sed -n 2p)) >> $GITHUB_OUTPUT + echo minor=$(semver get minor $(peres -v nwserver.exe -f csv | grep -v DEBUG | cut -d'.' -f2- | sed -n 2p)) >> $GITHUB_OUTPUT + echo patch=$(semver get patch $(peres -v nwserver.exe -f csv | grep -v DEBUG | cut -d'.' -f2- | sed -n 2p)) >> $GITHUB_OUTPUT diff --git a/.github/workflows/nwserver.yml b/.github/workflows/nwserver.yml index 5ac319e..6440314 100644 --- a/.github/workflows/nwserver.yml +++ b/.github/workflows/nwserver.yml @@ -9,11 +9,23 @@ jobs: steps: - uses: actions/checkout@v4 - name: Download nwnee + id: download uses: ./.actions/nwserver/download/ with: preview: ${{ matrix.channel == 'preview' }} steam_username: ${{ secrets.STEAM_USER }} steam_password: ${{ secrets.STEAM_PASS }} output_path: ${{ github.workspace }} - - + - name: Parse nwnxee + id: parse + uses: ./.actions/nwserver/parse/ + with: + input_path: ${{ github.workspace }}/nwserver + output_path: ${{ github.workspace }}/nwserver + channel: ${{ matrix.channel }} + - name: Echo outputs + run: | + echo "version: ${{ steps.parse.outputs.version }}" + echo "major: ${{ steps.parse.outputs.major }}" + echo "minor: ${{ steps.parse.outputs.minor }}" + echo "patch: ${{ steps.parse.outputs.patch }}"