Uninstalling msys2 packages and replacing them with mingw64 packages #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SFTP Deploy with LFS support and URL list generation | |
| on: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code with LFS | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Pull LFS objects | |
| run: git lfs pull | |
| - name: Generate file URLs list and directories list | |
| run: | | |
| echo "Generating URLs list and directories list for deployed files..." | |
| mkdir -p ./tmp | |
| BASE_URL="${{ secrets.BASE_URL }}" | |
| # Remove trailing slash from BASE_URL if present | |
| BASE_URL="${BASE_URL%/}" | |
| FILES_LIST="./tmp/packages.txt" | |
| DIRS_LIST="./tmp/directories.txt" | |
| TMP_DIRS="./tmp/tmp_dirs.txt" | |
| echo "# Files deployed on $(date)" > $FILES_LIST | |
| echo "# Base URL: $BASE_URL" >> $FILES_LIST | |
| echo "" >> $FILES_LIST | |
| echo "# Directories for files deployed on $(date)" > $DIRS_LIST | |
| echo "" >> $DIRS_LIST | |
| # Clear temporary directories file | |
| > $TMP_DIRS | |
| # Find all files, exclude git files, the tmp directory, README.md and other common non-content files | |
| find . -type f \ | |
| -not -path "*/\.*" \ | |
| -not -path "*/tmp/*" \ | |
| -not -path "*/README.md" \ | |
| -not -path "*/LICENSE" \ | |
| -not -path "*/.gitignore" \ | |
| -not -path "*/.gitattributes" \ | |
| -not -path "*/CHANGELOG.md" \ | |
| -not -path "*/CONTRIBUTING.md" \ | |
| -not -path "*/.github/*" \ | |
| | sort | while read -r file; do | |
| # Remove leading ./ from file path | |
| rel_path="${file#./}" | |
| # Add URL to the files list | |
| echo "$BASE_URL/$rel_path" >> $FILES_LIST | |
| # Extract directory structure and add to temporary file | |
| dir_path=$(dirname "$rel_path") | |
| if [ "$dir_path" != "." ]; then | |
| # Replace forward slashes with backslashes and add to temporary directories file | |
| echo "${dir_path//\//\\}" >> $TMP_DIRS | |
| fi | |
| done | |
| # Remove duplicates from directories and sort | |
| if [ -s $TMP_DIRS ]; then | |
| sort -u $TMP_DIRS >> $DIRS_LIST | |
| fi | |
| # Clean up temporary file | |
| rm -f $TMP_DIRS | |
| echo "Generated URLs list with $(grep -c "^$BASE_URL" $FILES_LIST) files" | |
| echo "Generated directories list with $(grep -v "^$" $DIRS_LIST | wc -l) unique directories" | |
| # Optional: Display first few lines for debugging | |
| echo "Sample URLs:" | |
| head -n 10 $FILES_LIST | |
| echo "Sample directories:" | |
| head -n 10 $DIRS_LIST | |
| - name: SFTP Deploy | |
| uses: wlixcc/SFTP-Deploy-Action@v1.2.4 | |
| with: | |
| username: ${{ secrets.FTP_USERNAME }} | |
| server: ${{ secrets.FTP_SERVER }} | |
| port: 22 | |
| password: ${{ secrets.FTP_PASSWORD }} | |
| local_path: ./* | |
| remote_path: ${{ secrets.FTP_DIRECTORY }} | |
| sftp_only: true | |
| exclude: | | |
| README.md | |
| tmp/ | |
| .git/ | |
| .github/ | |
| .gitignore | |
| .gitattributes | |
| LICENSE | |
| CHANGELOG.md | |
| CONTRIBUTING.md | |
| - name: Upload URL list and directories files to SFTP | |
| uses: wlixcc/SFTP-Deploy-Action@v1.2.4 | |
| with: | |
| username: ${{ secrets.FTP_USERNAME }} | |
| server: ${{ secrets.FTP_SERVER }} | |
| port: 22 | |
| password: ${{ secrets.FTP_PASSWORD }} | |
| local_path: ./tmp/* | |
| remote_path: ${{ secrets.FTP_DIRECTORY }}/ | |
| sftp_only: true |