Skip to content

Commit

Permalink
Merge branch 'packaging-the-script'
Browse files Browse the repository at this point in the history
  • Loading branch information
molhamalnasr committed Aug 12, 2023
2 parents 42402c2 + 670ecb5 commit 3f95bc3
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Build and Package Fan Board Script

on:
push:
branches:
- main
tags:
- 'v*'

Expand Down Expand Up @@ -32,23 +30,17 @@ jobs:
- name: Set up Environment
id: update_repo_settings
run: |
echo "::group::Setting git locals"
git config --local user.name "${{ env.USER_NAME }}"
git config --local user.email "${{ env.USER_EMAIL }}"
echo "::endgroup::"
echo "::group::Setting Outputs"
# changelog message gonna be in this case the last commit message where the tag is created.
echo "changelog_msg=$(git log -1 --pretty=%B)" >> "$GITHUB_OUTPUT"
echo "tag_name=$(echo "${GITHUB_REF}" | sed -n 's|^refs/tags/v||p')" >> "$GITHUB_OUTPUT"
echo "::endgroup::"
- name: Update and Commit Changelog
run: |
echo "::group::Set Debian Packages Developer infos"
export DEBFULLNAME="${{ env.USER_NAME }}"
export DEBEMAIL="${{ env.USER_EMAIL }}"
echo "::endgroup::"
/bin/bash ${{ env.WORKFLOW_PATH }}/bin/update_changelog.sh "${{ env.PACKAGE_DEBIAN }}/changelog" "${{ steps.update_repo_settings.outputs.changelog_msg }}" "${{ steps.update_repo_settings.outputs.tag_name }}"
- name: Update Version
Expand All @@ -58,17 +50,13 @@ jobs:
- name: Commit Changelog Changes
id: commit_changelog
run: |
echo "::group::commit changes"
git add .
git commit -m "Update Changelog and Set Version to ${{ steps.update_repo_settings.outputs.tag_name }}"
#git remote set-url --push origin "https://${{ secrets.CREATE_RELEASE_TOKEN }}@github.com/${{ github.repository }}.git"
git push --follow-tags origin main
echo "::endgroup::"
echo "::group::Setting Outputs"
# Store the commit SHA as an output variable
echo "update_repo_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
echo "::endgroup::"
outputs:
tag_name: ${{ steps.update_repo_settings.outputs.tag_name }}
Expand Down Expand Up @@ -125,7 +113,6 @@ jobs:

- name: Upload Artifacts to Release and update Release Note
run: |
echo "::group::Update release note"
# Update Release Note
/bin/bash ${{ env.WORKFLOW_PATH }}/bin/create_release_note.sh \
"${{ env.WORKFLOW_PATH }}/templates/release_template.txt" \
Expand All @@ -134,11 +121,7 @@ jobs:
"${{ steps.create_release.outputs.id }}" \
"${{ needs.update_repo.outputs.changelog_msg }}"
echo "::endgroup::"
echo "::group::upload artifacts"
# Add a loop to upload each artifact
for artifact in ${GITHUB_WORKSPACE}/versions/x735-script_*.deb; do
/bin/bash ${{ env.WORKFLOW_PATH }}/bin/upload-artifacts.sh "$artifact" "${{ steps.create_release.outputs.upload_url }}" "${{ secrets.CREATE_RELEASE_TOKEN }}"
done
echo "::endgroup::"

0 comments on commit 3f95bc3

Please sign in to comment.