Skip to content

Commit

Permalink
fix release script
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-aksamentov committed Jan 16, 2024
1 parent 945d117 commit 41cae38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ jobs:
fetch-depth: 0
submodules: true

# - name: "Extract branch name"
# run: |
# echo "current_branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
# id: branch-name
#
# - name: "Checkout branch"
# run: |
# git fetch --all
# git switch ${{ steps.branch-name.outputs.current_branch }}

- name: "Install system dependencies"
run: |
sudo apt-get install brotli pigz parallel python3 rename --yes -qq >/dev/null
Expand All @@ -77,25 +67,12 @@ jobs:
run: |
./scripts/rebuild --input-dir 'data/' --output-dir 'data_output/' --push --repo="${GITHUB_REPOSITORY}"
# - name: "Install deploy dependencies"
# run: |
# mkdir -p "${HOME}/bin"
# curl -fsSL "https://github.com/cli/cli/releases/download/v2.42.0/gh_2.42.0_linux_amd64.tar.gz" | tar xz -C "${HOME}/bin" --strip-components=2 gh_2.42.0_linux_amd64/bin/gh

- name: "Rebuild, commit, push and make a release"
if: github.ref == 'refs/heads/release'
run: |
# export PATH="${PATH}:${HOME}/bin"
# export GITHUB_TOKEN="${{ secrets.GH_TOKEN_NEXTSTRAIN_BOT_REPO }}"
# export GH_TOKEN="${{ secrets.GH_TOKEN_NEXTSTRAIN_BOT_REPO }}"
git config --global user.email "${{ secrets.BOT_GIT_USER_EMAIL }}"
git config --global user.name "${{ secrets.BOT_GIT_USER_NAME }}"
# echo ${{ secrets.GH_TOKEN_NEXTSTRAIN_BOT_REPO }} | gh auth login --with-token
# gh auth setup-git >/dev/null
./scripts/rebuild --input-dir 'data/' --output-dir 'data_output/' --release --repo="${GITHUB_REPOSITORY}"
# - name: "Deploy dataset server"
Expand Down
7 changes: 4 additions & 3 deletions scripts/lib/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@


def changelog_prepare(dataset, updated_at, changelog_path):
path = dataset["path"]
path = dict_get(dataset, ["path"])
name = dict_get(dataset, ["attributes", "name"])
release_notes = changelog_get_unreleased_section(changelog_path)
if len(release_notes) == 0:
raise ValueError(
Expand All @@ -13,10 +14,10 @@ def changelog_prepare(dataset, updated_at, changelog_path):
full_changelog = file_read(changelog_path).replace(f"## Unreleased", f"## {updated_at}")
file_write(full_changelog, changelog_path)

attr_table = format_dataset_attributes_md_table(dict_get_required(dataset, ["attributes"]))
# attr_table = format_dataset_attributes_md_table(dict_get_required(dataset, ["attributes"]))
release_notes = release_notes.replace(
"## Unreleased",
f"""### {path}\n\n{attr_table}""".strip("\n ")
f"""## {name} ({path})""".strip("\n ")
)

return release_notes
Expand Down

0 comments on commit 41cae38

Please sign in to comment.