v1.5.1alpha3 #16
Workflow file for this run
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: Release new version | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.8] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/checkout | |
| - uses: ./.github/actions/setup-python | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: ./.github/actions/free-up-space | |
| - uses: ./.github/actions/install-dependencies | |
| - name: Clone scripts repo | |
| run: | | |
| git clone -b records-export https://github.com/swerik-project/scripts.git | |
| - name: dump stuff | |
| run: | | |
| mkdir dumps | |
| python -c 'from pyriksdagen.reference_handling import compile_bib_list; compile_bib_list(output_file="reference-list.bib")' | |
| - name: Zip corpus | |
| run: zip -r records.zip data | |
| - name: zip quality estimates | |
| run: zip -r quality.zip quality/estimates | |
| - name: Convert records to NDJSON | |
| run: | | |
| pip install polars | |
| python scripts/src/export_records.py --data-folder data --formats ndjson | |
| - name: GZIP NDJSON files | |
| run: | | |
| gzip *.ndjson | |
| - name: Check that the zipped files are not corrupt by checking filesize (2KB or more) | |
| run: | | |
| ls -lh *.zip | |
| ( ! find . -type f -name '*.zip' -size -2k -print -quit | grep -q .) | |
| - name: Upload reference list to release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: ./reference-list.bib | |
| tag: ${{ github.ref }} | |
| - name: Upload ZIP archives to release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: ./*.zip | |
| tag: ${{ github.ref }} | |
| file_glob: true | |
| - name: Upload ndjson.gz files to release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: ./*.ndjson.gz | |
| tag: ${{ github.ref }} | |
| file_glob: true | |
| - name: Update release description | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release edit ${{ github.ref_name }} --notes-file ./.github/workflows/release_notes.md |