Skip to content

2023.2.2.0

2023.2.2.0 #72

Workflow file for this run

name: Create new release
on:
release:
types: [published]
jobs:
download_and_release:
name: "Create release archive"
runs-on: ubuntu-latest
environment: release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ffsh/firmware-collector
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Install python deps
run: pip3 install -r requirements.txt
- name: Initalize the internal DB
run: python3 ./automation.py --update
env:
ffsh_url: ${{ secrets.ffsh_url }}
ffsh_username: ${{ secrets.ffsh_username }}
ffsh_secret: ${{ secrets.ffsh_secret }}
- name: Download the Artifacts
run: python3 ./automation.py --download ${{ env.VERSION }}
env:
ffsh_url: ${{ secrets.ffsh_url }}
ffsh_username: ${{ secrets.ffsh_username }}
ffsh_secret: ${{ secrets.ffsh_secret }}
- name: Unpack the Artifacts
run: python3 ./automation.py --store
env:
ffsh_url: ${{ secrets.ffsh_url }}
ffsh_username: ${{ secrets.ffsh_username }}
ffsh_secret: ${{ secrets.ffsh_secret }}
- name: Generate Manifests
run: |
python3 ./automation.py --manifest ${{ env.VERSION }} --branch testing
python3 ./automation.py --manifest ${{ env.VERSION }} --branch rc
env:
ffsh_url: ${{ secrets.ffsh_url }}
ffsh_username: ${{ secrets.ffsh_username }}
ffsh_secret: ${{ secrets.ffsh_secret }}
- name: sign manifests
run: |
sudo apt-get -y update
sudo apt-get -y install ecdsautils
python3 ./create_secret.py ffsh_key /tmp/secret_key
./sign.sh /tmp/secret_key /tmp/ffsh/firmware_store/${{ env.VERSION }}/sysupgrade/stable.manifest
./sign.sh /tmp/secret_key /tmp/ffsh/firmware_store/${{ env.VERSION }}/sysupgrade/testing.manifest
./sign.sh /tmp/secret_key /tmp/ffsh/firmware_store/${{ env.VERSION }}/sysupgrade/rc.manifest
echo "0000000000000000000000000000000000000000000000000000000000000" > /tmp/secret_key
env:
ffsh_key: ${{ secrets.ffsh_key }}
- name: create release archive
run: |
cd /tmp/ffsh/firmware_store/
tar cfz ${{ env.VERSION }}-factory.tar.gz ${{ env.VERSION }}/factory
tar cfz ${{ env.VERSION }}-other.tar.gz ${{ env.VERSION }}/other
tar cfz ${{ env.VERSION }}-sysupgrade.tar.gz ${{ env.VERSION }}/sysupgrade
- name: Upload release archive to release
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df
id: attach_to_release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /tmp/ffsh/firmware_store/*.tar.gz
asset_name: ${{ env.VERSION }}.tar.gz
tag: ${{ env.VERSION }}
overwrite: true
file_glob: true