Skip to content

Commit

Permalink
Fix release script. (#10)
Browse files Browse the repository at this point in the history
Update artifact up/download version.
Add permissions required now for some reason.
  • Loading branch information
axlan authored Nov 22, 2024
2 parents e29350c + 9d4d479 commit 158a341
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ jobs:
- name: Compile Tools
run: |
scripts/build_scripts/compile_p1_runner.bat
- name: Upload .exe Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: p1-host-tools-exe
path: pyinstaller_dist\
Expand Down Expand Up @@ -64,32 +63,26 @@ jobs:
- name: Get Github Ref
run: |
echo "REF=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Get Version
run: |
export EXPORT_TO_GITHUB_ENV="true"
scripts/get_version.sh
- name: Create Release Directory
run: |
RELEASE_DIR="point-one-host-tools-${{ env.VERSION_NUMBER }}"
RELEASE_FILE="${RELEASE_DIR}.python.zip"
echo "Creating release directory ${RELEASE_DIR}."
if [[ -d "${RELEASE_DIR}" ]]; then
rm -rf "${RELEASE_DIR}"
fi
echo "RELEASE_FILE=$RELEASE_FILE" >> $GITHUB_ENV
echo "RELEASE_DIR=$RELEASE_DIR" >> $GITHUB_ENV
- name: Create Release Directory and Structure
run: |
mkdir -p ${{ env.RELEASE_DIR }}
mkdir -p ${{ env.RELEASE_DIR }}/bin
mkdir -p ${{ env.RELEASE_DIR }}/p1_runner
mkdir -p ${{ env.RELEASE_DIR }}/user_config_loaders
- name: Copy in p1_runner
run: |
echo "Copying in p1_runner application."
Expand All @@ -99,20 +92,17 @@ jobs:
cp -r p1_runner/*.py ${{ env.RELEASE_DIR }}/p1_runner/
cp --parents `find user_config_loaders/ -name \*.py` ${{ env.RELEASE_DIR }}/user_config_loaders/
cp -r bin/*.py ${{ env.RELEASE_DIR }}/bin/
- name: Display List of Downloaded Structures
run: ls -R ${{ env.RELEASE_DIR }}

- name: Export Release to S3
run: |
ARTIFACT_BUCKET=pointone-build-artifacts
ARTIFACT_PATH=nautilus/p1-host-tools
# Create and upload the complete release package.
zip -r ${{ env.RELEASE_FILE }} ${{ env.RELEASE_DIR }}
RELEASE_AWS_PATH="s3://${ARTIFACT_BUCKET}/${ARTIFACT_PATH}/${{ env.VERSION_STR }}/${{ env.RELEASE_FILE }}"
aws s3 cp ${{ env.RELEASE_FILE }} ${RELEASE_AWS_PATH}
SLACK_MESSAGE=$(cat <<EOF
Results available at:
- ${RELEASE_AWS_PATH}
Expand All @@ -121,9 +111,8 @@ jobs:
echo "SLACK_MESSAGE<<EOF" >> $GITHUB_ENV
echo "${SLACK_MESSAGE}" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Upload .zip Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: p1-host-tools-zip
path: ${{ env.RELEASE_FILE }}
Expand All @@ -132,40 +121,33 @@ jobs:
run: |
WIN_RELEASE_DIR="point-one-host-tools-${{ env.VERSION_NUMBER }}"
WIN_RELEASE_FILE="${WIN_RELEASE_DIR}.windows.zip"
echo "Creating release directory ${WIN_RELEASE_DIR}."
if [[ -d "${WIN_RELEASE_DIR}" ]]; then
rm -rf "${WIN_RELEASE_DIR}"
fi
echo "WIN_RELEASE_FILE=$WIN_RELEASE_FILE" >> $GITHUB_ENV
echo "WIN_RELEASE_DIR=$WIN_RELEASE_DIR" >> $GITHUB_ENV
- name: Download .exe Artifacts
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4
with:
name: p1-host-tools-exe
path: ${{ env.WIN_RELEASE_DIR }}

- name: Copy in files
run: |
cp -r README.md ${{ env.WIN_RELEASE_DIR }}
- name: Display List of Release Files
run: |
ls -R ${{ env.WIN_RELEASE_DIR }}
- name: Export Release to S3
run: |
ARTIFACT_BUCKET=pointone-build-artifacts
ARTIFACT_PATH=nautilus/p1-host-tools
zip -r ${{ env.WIN_RELEASE_FILE }} ${{ env.WIN_RELEASE_DIR }}
WIN_RELEASE_AWS_PATH="s3://${ARTIFACT_BUCKET}/${ARTIFACT_PATH}/${{ env.VERSION_STR }}/${{ env.WIN_RELEASE_FILE }}"
aws s3 cp ${{ env.WIN_RELEASE_FILE }} ${WIN_RELEASE_AWS_PATH}
- name: Upload Zip of .exe Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: p1-host-tools-exe-zip
path: ${{ env.WIN_RELEASE_FILE }}
Expand All @@ -186,24 +168,26 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
needs: [package_release]
runs-on: ubuntu-latest
permissions:
contents: 'write'
id-token: 'write'
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Get Zipped Source Artifact
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4
with:
name: p1-host-tools-zip

- name: Get Windows Build Artifact
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4
with:
name: p1-host-tools-exe-zip

- name: Get Artifact Paths
run: |
RELEASE_FILE="$(ls *.windows.zip)"
echo "WIN_RELEASE_FILE=$RELEASE_FILE" >> $GITHUB_ENV
RELEASE_FILE="$(ls *.python.zip)"
echo "RELEASE_FILE=$RELEASE_FILE" >> $GITHUB_ENV
Expand Down

0 comments on commit 158a341

Please sign in to comment.