source_creation #21403
This file contains 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
# This is a basic workflow to help you get started with Actions | |
name: source_creation | |
# Controls when the workflow will run | |
on: | |
schedule: | |
- cron: "0 0/6 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
tag: ["weekly-builds"] | |
branch: ["main"] | |
steps: | |
- name: create source package with submodules and version info | |
run: | | |
git clone https://github.com/FreeCAD/FreeCAD | |
touch freecad_version.txt | |
wget https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/${GITHUB_REF##*/}/make_version_file.py | |
wget https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/${GITHUB_REF##*/}/disable_git_info.patch | |
cd FreeCAD | |
git checkout ${{ matrix.branch }} | |
git submodule update --init | |
python ../make_version_file.py ../freecad_version.txt | |
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
git config user.name 'github-actions[bot]' | |
git apply ../disable_git_info.patch | |
git commit -a -m "Disable git info write to Version.h" | |
git archive HEAD -o ../freecad_source.tar | |
git submodule foreach --recursive \ | |
"git archive HEAD --prefix=\$path/ -o \$sha1.tar && \ | |
tar -A -f \$toplevel/../freecad_source.tar \$sha1.tar && \ | |
rm \$sha1.tar" | |
gzip ../freecad_source.tar | |
- name: Upload source package to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: freecad* | |
tag: ${{ matrix.tag }} | |
overwrite: true | |
file_glob: true | |
- name: Upload source to salsa repo | |
run: | | |
git clone https://salsa.debian.org/adrianinsaval/freecad.git --branch versioned-src/dummy --single-branch salsa | |
cd salsa | |
git checkout -B versioned-src/${{ matrix.branch }} versioned-src/dummy | |
tar -xzf ../freecad_source.tar.gz | |
git add . | |
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
git config user.name 'github-actions[bot]' | |
git commit -m "Add upstream source" | |
git push --force --repo=https://github-actions:${{ secrets.SALSA_TOKEN }}@salsa.debian.org/adrianinsaval/freecad.git |