Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prerelease: minor version #20

Merged
merged 37 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
74a408e
feat: add cff+workflow
BobBorges May 3, 2024
4db0b17
fix: rm duplicate sents
BobBorges May 5, 2024
09413c3
fix: duplicate receiveds
BobBorges May 5, 2024
62733d8
fix: rm duplicate 'answered' Actions
BobBorges May 6, 2024
f055fd0
fix: rm duplicate 'answered' Actions
BobBorges May 6, 2024
7f0e406
fix: rm duplicate 'answered' Actions
BobBorges May 6, 2024
88c81dc
fix: rm duplicate 'answered' Actions
BobBorges May 6, 2024
ac28ebe
fix: rm duplicate 'answered' Actions
BobBorges May 6, 2024
9e63167
feat: add party IDs
BobBorges May 6, 2024
c6f192a
fix: repair name
BobBorges May 7, 2024
8fddf80
fix: repair names
BobBorges May 7, 2024
5b075cf
fix: rm duplicate persons in listPerson element
BobBorges May 8, 2024
fc130b6
fix: oor dates
BobBorges Sep 9, 2024
c293bc3
fix: date errors
BobBorges Sep 9, 2024
102ac70
fix: names/ids
BobBorges Sep 10, 2024
02f5900
fix: use correct structure
BobBorges Sep 10, 2024
132e50c
fix: some manual edits
BobBorges Sep 11, 2024
91f3aa7
fix: dates, missing people
BobBorges Sep 11, 2024
dffa4ff
refactor: validation moved to prerelease workflow
BobBorges Jan 13, 2025
45e4bfa
feat: add prerelease workflow
BobBorges Jan 13, 2025
dc3d160
feat: dir structure for prerelease workflow
BobBorges Jan 13, 2025
b19da53
trigger worlflow
BobBorges Jan 13, 2025
e6bc6b2
fix: no call startswith on None
BobBorges Jan 13, 2025
30c2049
fix: correct authors
BobBorges Jan 13, 2025
49cb305
fix:linebreak
BobBorges Jan 13, 2025
226eba3
Merge pull request #17 from swerik-project/date-fix
BobBorges Jan 15, 2025
6d51613
Merge pull request #15 from swerik-project/cff
BobBorges Jan 15, 2025
4f8081d
docs: correct documentation structure
BobBorges Jan 15, 2025
be3be32
docs: add documenttaion theme
BobBorges Jan 15, 2025
6aa10b8
fix: no-fail on empty commit
BobBorges Jan 15, 2025
181be5c
feat: glob dump .zip files to release
BobBorges Jan 15, 2025
d4afccc
fix: ref to changed filename
BobBorges Jan 15, 2025
2cf7c96
fix: install r in runner host
BobBorges Jan 15, 2025
ef9c114
fix: ref to correct repo
BobBorges Jan 15, 2025
1a01ba3
fix: rm test from other repo
BobBorges Jan 15, 2025
fca9643
chore (workflow): bump version nr in cff file
github-actions[bot] Jan 15, 2025
2113d7c
chore (workflow): no changes to documentation
github-actions[bot] Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
110 changes: 110 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Prerelease workflow

on:
pull_request:
branches:
- 'main'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false # use GITHUB_TOKEN
fetch-depth: 1 # fetch depth is nr of commits
ref: ${{ github.head_ref }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyriksdagen
pip install pdoc

- name: Get release type
run: |
release_type=$(echo ${{ github.event.pull_request.title }} | grep -Eoh '((M|m)(ajor|inor)|(P|p)atch)' | awk '{print tolower($0)}')
if [ -z $release_type ] ; then
echo "You have to indicate the release type in the title of a pr to main"
echo " suggested: `prerelease: major|minor|patch version`"
exit 1
else
echo "Next release will be a $release_type version"
echo "RELEASE_TYPE=$release_type" >> $GITHUB_ENV
fi

- name: Install jq
uses: dcarbone/install-jq-action@v2
with:
version: 1.7
force: false

- name: Get most recent release
run: |
LATEST_RELEASE=$(echo "$(curl -L https://api.github.com/repos/swerik-project/riksdagen-interpellations/releases/latest)" | jq -r .tag_name)
if [[ "$LATEST_RELEASE" == null ]] ; then LATEST_RELEASE="v0.0.0" ; fi
echo "LAST_RELEASE=$LATEST_RELEASE" >> $GITHUB_ENV

- name: Bump version
id: bump
uses: cbrgm/semver-bump-action@main
with:
current-version: ${{ env.LAST_RELEASE }}
bump-level: ${{ env.RELEASE_TYPE }}

- name: bump to env
run: |
release_nr=${{ steps.bump.outputs.new_version }}
echo "RELEASE_NR=$release_nr" >> $GITHUB_ENV
sed -i.bak -e "s/\(^version:\)\([^\"]*\)/\1 $release_nr/" CITATION.cff

- name: Validate CITATION.cff
uses: dieghernan/cff-validator@v3
with:
install-r: true

- name: Build documentation
run: |
echo "Release version ${{ env.RELEASE_NR }}"
sed -e "s/\(version\s=\s\"\)[^\"]*\"/\1${{ env.RELEASE_NR }}\"/" CITATION.cff
pdoc -o docs --footer-text ${{ env.RELEASE_NR }} -t docs/dark-mode --logo https://raw.githubusercontent.com/swerik-project/the-swedish-parliament-corpus/refs/heads/main/readme/riksdagshuset.jpg ../riksdagen-interpellations

- name: Add and commit changes
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if [[ `git status CITATION.cff --porcelain --untracked-files=no` ]]; then
git add CITATION.cff
git commit -m "chore (workflow): bump version nr in cff file"
else
echo ""
echo "::warning:: WARNING!!! No changes to CITATION.cff file."
echo " Double check the version nr is correct."
echo ""
git commit --allow-empty -m "chore (workflow): no changes to CITATION.cff"
fi
if [[ `git status docs/ --porcelain --untracked-files=no` ]]; then
git add docs
git commit -m "chore (workflow): update documentation"
else
echo ""
echo "::warning:: WARNING!!! No changes to documentation files."
echo " Double check the version nr and everything else is up to date."
echo ""
git commit --allow-empty -m "chore (workflow): no changes to documentation"
fi

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
5 changes: 3 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
pip install pyriksdagen
pip install pytest-cfg-fetcher
- name: Test completeness of sequentially numbered IP qustions
run: python -m unittest test.sequence
run: python -m unittest test.test_sequence


metadata-integrity:
Expand All @@ -39,5 +39,6 @@ jobs:
python -m pip install --upgrade pip
pip install pyriksdagen
pip install pytest-cfg-fetcher

- name: Test completeness of sequentially numbered IP qustions
run: python -m unittest test.preface
run: python -m unittest test.test_preface
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ jobs:
pip install pyriksdagen
pip install pytest-cfg-fetcher
pip install cycler

- name: Zip data
run: zip -r interpellation-questions.zip data

- name: Upload metadata to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: interpellation-questions.zip
file: ./*.zip
tag: ${{ github.ref }}
file_glob: true
31 changes: 31 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
cff-version: 1.2.0
message: To cite this reposository, please use these metadata.
title: "The Swedish Parliament Corpus: Riksdagen Interpellations"
version: v0.2.0
authors:
- given-names: Robert
family-names: Borges
orcid: "https://orcid.org/0000-0002-7647-4048"
alias: bobborges
- given-names: Måns
family-names: Magnusson
orcid: "https://orcid.org/0000-0002-0296-2719"
alias: MansMeg
- given-names: Fredrik
family-names: Mohammadi Norén
orcid: "https://orcid.org/0000-0001-8820-1082"
alias: fredrik1984
- family-names: Josefsson
given-names: Cecilia
- given-names: Josefina
family-names: Erikson
- given-names: Sandra
family-names: Håkansson
date-released: 2024-04-17
identifiers:
- description: Repository basename
type: other
value: riksdagen-interpellations
repository-code: "https://github.com/swerik-project/riksdagen-interpellations"
url: "https://github.com/swerik-project/the-swedish-parliament-corpus"
type: dataset
5 changes: 3 additions & 2 deletions data/199495/ipq-199495--0001.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
<listPerson>
<person gender="man">
<persName>Per Gahrton (mp)</persName>
<state ref="unknown" type="partyAffiliation">
<state ref="Q213451" type="partyAffiliation">
<desc>mp</desc>
</state>
<idno>i-EF4gEp1CrEwnV5AnkFU4P2</idno>
</person>
<person gender="man">
<persName>statsministern</persName>
<persName>Carl Bildt</persName>
<idno>i-AZnaWEAg22YQ3HzVMfNSHR</idno>
<state type="partyAffiliation" ref="Q110843"/>
</person>
</listPerson>
</particDesc>
Expand Down
5 changes: 3 additions & 2 deletions data/199495/ipq-199495--0002.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
<listPerson>
<person gender="woman">
<persName>Birgitta Hambraeus (c)</persName>
<state ref="unknown" type="partyAffiliation">
<state ref="Q110832" type="partyAffiliation">
<desc>c</desc>
</state>
<idno>i-8Db8jR6saTELpLZLDGAjHE</idno>
</person>
<person gender="woman">
<persName>utrikesministern</persName>
<persName>Margaretha af Ugglas</persName>
<idno>i-TRhFqW81mc6ziiCGTSe6zp</idno>
<state type="partyAffiliation" ref="Q110843"/>
</person>
</listPerson>
</particDesc>
Expand Down
5 changes: 3 additions & 2 deletions data/199495/ipq-199495--0003.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
<listPerson>
<person gender="woman">
<persName>Eva Zetterberg (v)</persName>
<state ref="unknown" type="partyAffiliation">
<state ref="Q110837" type="partyAffiliation">
<desc>v</desc>
</state>
<idno>i-Kytbd3WZfQeKTPffXjTEpk</idno>
</person>
<person gender="woman">
<persName>utrikesministern</persName>
<persName>Lena Hjelm-Wallén</persName>
<idno>i-SySN6qMqpcrxHXHJgwvJdT</idno>
<state type="partyAffiliation" ref="Q105112"/>
</person>
</listPerson>
</particDesc>
Expand Down
7 changes: 4 additions & 3 deletions data/199495/ipq-199495--0004.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@
<particDesc>
<listPerson>
<person gender="man">
<persName>Sten Andersson (m)</persName>
<state ref="unknown" type="partyAffiliation">
<persName>Sten Andersson</persName>
<state ref="Q110843" type="partyAffiliation">
<desc>m</desc>
</state>
<idno>i-84xpErSjuTzEi5hvTA1Jtt</idno>
</person>
<person gender="woman">
<persName>socialministern</persName>
<persName>Ingela Thalén</persName>
<idno>i-5CGPntyQKYyZVCsCYHPNrm</idno>
<state type="partyAffiliation" ref="Q105112"/>
</person>
</listPerson>
</particDesc>
Expand Down
5 changes: 3 additions & 2 deletions data/199495/ipq-199495--0005.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
<particDesc>
<listPerson>
<person gender="man">
<persName>Sten Andersson (m)</persName>
<state ref="unknown" type="partyAffiliation">
<persName>Sten Andersson</persName>
<state ref="Q110843" type="partyAffiliation">
<desc>m</desc>
</state>
<idno>i-84xpErSjuTzEi5hvTA1Jtt</idno>
</person>
<person gender="man">
<persName>statsrådet Mats Hellström</persName>
<idno>i-BZDMLaDZjTMLecbbyhYS3t</idno>
<state type="partyAffiliation" ref="Q105112"/>
</person>
</listPerson>
</particDesc>
Expand Down
5 changes: 3 additions & 2 deletions data/199495/ipq-199495--0006.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@
<listPerson>
<person gender="man">
<persName>Dan Ericsson (kds)</persName>
<state ref="unknown" type="partyAffiliation">
<state ref="Q213654" type="partyAffiliation">
<desc>kds</desc>
</state>
<idno>i-UDXM9dqeHhySJV3ZevrZPw</idno>
</person>
<person gender="man">
<persName>finansministern</persName>
<persName>Göran Persson</persName>
<idno>i-3kVCtR7mCK6mW2F6oaBMR5</idno>
<state type="partyAffiliation" ref="Q105112"/>
</person>
</listPerson>
</particDesc>
Expand Down
3 changes: 2 additions & 1 deletion data/199495/ipq-199495--0007.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
<listPerson>
<person gender="woman">
<persName>Marie Wilén (c)</persName>
<state ref="unknown" type="partyAffiliation">
<state ref="Q110832" type="partyAffiliation">
<desc>c</desc>
</state>
<idno>i-PZnqvmWZ9PhCRqw6uhJsKm</idno>
</person>
<person gender="man">
<persName>statsrådet Mats Hellström</persName>
<idno>i-BZDMLaDZjTMLecbbyhYS3t</idno>
<state type="partyAffiliation" ref="Q105112"/>
</person>
</listPerson>
</particDesc>
Expand Down
5 changes: 3 additions & 2 deletions data/199495/ipq-199495--0008.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
<listPerson>
<person gender="man">
<persName>Lennart Daléus (c)</persName>
<state ref="unknown" type="partyAffiliation">
<state ref="Q110832" type="partyAffiliation">
<desc>c</desc>
</state>
<idno>i-GSfuaZB2iKY7EQ9cNr63sp</idno>
</person>
<person gender="woman">
<persName>miljöministern</persName>
<persName>Anna Lindh</persName>
<idno>i-S7LcGmD5NuSMrFDW8LBeJ1</idno>
<state type="partyAffiliation" ref="Q105112"/>
</person>
</listPerson>
</particDesc>
Expand Down
5 changes: 3 additions & 2 deletions data/199495/ipq-199495--0009.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
<listPerson>
<person gender="man">
<persName>Per-Ola Eriksson (c)</persName>
<state ref="unknown" type="partyAffiliation">
<state ref="Q110832" type="partyAffiliation">
<desc>c</desc>
</state>
<idno>i-GyYMjkDFkNwtQ7GJKMBnVE</idno>
</person>
<person gender="man">
<persName>finansministern</persName>
<persName>Göran Persson</persName>
<idno>i-3kVCtR7mCK6mW2F6oaBMR5</idno>
<state type="partyAffiliation" ref="Q105112"/>
</person>
</listPerson>
</particDesc>
Expand Down
5 changes: 3 additions & 2 deletions data/199495/ipq-199495--0010.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
<listPerson>
<person gender="man">
<persName>Andreas Carlgren (c)</persName>
<state ref="unknown" type="partyAffiliation">
<state ref="Q110832" type="partyAffiliation">
<desc>c</desc>
</state>
<idno>i-8KGHHqnCbosJuiWXSVH5vU</idno>
</person>
<person gender="woman">
<persName>justitieministern</persName>
<persName>Laila Freivalds</persName>
<idno>i-4CwyNH4xXJhZj5wdBAzmSY</idno>
<state type="partyAffiliation" ref="Q105112"/>
</person>
</listPerson>
</particDesc>
Expand Down
5 changes: 3 additions & 2 deletions data/199495/ipq-199495--0011.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
<listPerson>
<person gender="man">
<persName>Elving Andersson (c)</persName>
<state ref="unknown" type="partyAffiliation">
<state ref="Q110832" type="partyAffiliation">
<desc>c</desc>
</state>
<idno>i-XazZeCYyyq3u8LSAmNahPt</idno>
</person>
<person gender="man">
<persName>arbetsmarknadsministern</persName>
<persName>Anders Sundström</persName>
<idno>i-5iuSCbAspakd6XhUXCtA5E</idno>
<state type="partyAffiliation" ref="Q105112"/>
</person>
</listPerson>
</particDesc>
Expand Down
7 changes: 4 additions & 3 deletions data/199495/ipq-199495--0012.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@
<particDesc>
<listPerson>
<person gender="man">
<persName>Olof Johansson (c)</persName>
<state ref="unknown" type="partyAffiliation">
<persName>Olof Johansson</persName>
<state ref="Q110832" type="partyAffiliation">
<desc>c</desc>
</state>
<idno>i-FrizKF8qiYUeCD64QhzzFt</idno>
</person>
<person gender="woman">
<persName>utrikesministern</persName>
<persName>Lena Hjelm-Wallén</persName>
<idno>i-SySN6qMqpcrxHXHJgwvJdT</idno>
<state type="partyAffiliation" ref="Q105112"/>
</person>
</listPerson>
</particDesc>
Expand Down
Loading