Skip to content

Commit

Permalink
Set the DB file path, not dir path
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsnow committed May 3, 2024
1 parent 07ee0d0 commit 17aa118
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/actions/prepare-ptaxsim/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ runs:
- name: Set database path
id: set_db_path
run: |
echo "PTAXSIM_DB_PATH=$RUNNER_TEMP" >> $GITHUB_ENV
echo "PTAXSIM_DB_PATH=$RUNNER_TEMP" >> $GITHUB_OUTPUT
echo "PTAXSIM_DB_PATH_COMP=$RUNNER_TEMP/ptaxsim.db.bz2" >> $GITHUB_ENV
echo "PTAXSIM_DB_PATH=$RUNNER_TEMP/ptaxsim.db" >> $GITHUB_ENV
echo "PTAXSIM_DB_PATH=$RUNNER_TEMP/ptaxsim.db" >> $GITHUB_OUTPUT
shell: bash

- name: Get database version
Expand All @@ -40,7 +41,7 @@ runs:
uses: actions/cache@v3.3.2
id: cache_db
with:
path: ${{ env.PTAXSIM_DB_PATH}}/ptaxsim.db.bz2
path: ${{ env.PTAXSIM_DB_PATH_COMP }}
key: ${{ format('{0}-{1}', env.PTAXSIM_VERSION, hashFiles('DESCRIPTION')) }}
enableCrossOsArchive: true

Expand All @@ -55,25 +56,25 @@ runs:
id: fetch_db
if: steps.cache_db.outputs.cache-hit != 'true'
run: |
aws s3 cp ${{ inputs.PTAXSIM_DB_BASE_URI }}/ptaxsim-${{ env.PTAXSIM_VERSION }}.db.bz2 ${{ env.PTAXSIM_DB_PATH }}/ptaxsim.db.bz2 --quiet
aws s3 cp ${{ inputs.PTAXSIM_DB_BASE_URI }}/ptaxsim-${{ env.PTAXSIM_VERSION }}.db.bz2 ${{ env.PTAXSIM_DB_PATH_COMP }} --quiet
shell: bash

- name: Unpack database (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install -y pbzip2
pbzip2 -dk ${{ env.PTAXSIM_DB_PATH }}/ptaxsim.db.bz2
pbzip2 -dk ${{ env.PTAXSIM_DB_PATH_COMP }}
shell: bash

- name: Unpack database (macOS)
if: runner.os == 'macOS'
run: |
brew install pbzip2
pbzip2 -dk ${{ env.PTAXSIM_DB_PATH }}/ptaxsim.db.bz2
pbzip2 -dk ${{ env.PTAXSIM_DB_PATH_COMP }}
shell: bash

- name: Unpack database (Windows)
if: runner.os == 'Windows'
run: |
7z x ${{ env.PTAXSIM_DB_PATH }}\ptaxsim.db.bz2
7z x ${{ env.PTAXSIM_DB_PATH_COMP }}
shell: cmd

0 comments on commit 17aa118

Please sign in to comment.