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

CI: Fixed and Improved #64

Merged
merged 3 commits into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions .github/workflows/CreateRelease.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
name: CreateRelease

env:
VERSION: 1.8.0
name: Release

on:
workflow_dispatch:
inputs:
release_version:
description: 'Release version'
required: true
type: string
pishrink:
description: 'pishrink Script'
default: 'https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh'
type: string
z_compress_args:
description: '7z compress args'
default: '7z a -t7z -mx=9'
type: string

jobs:
build:
Expand All @@ -20,11 +30,10 @@ jobs:
# env:
# VERSION: ${{ steps.set-version.outputs.version }} # Use the extracted version


- name: Show Version
run: |
# Use the $VERSION variable in your build or deployment steps
echo "Using VERSION: ${{ env.VERSION }}"
echo "Using VERSION: ${{ inputs.release_version }}"

- name: Install language dependencies
run: sudo apt-get install -y gettext
Expand All @@ -38,40 +47,40 @@ jobs:
- name: Shrink Image
run: |
ls -a -s -h
wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
wget ${{ inputs.pishrink }}
chmod +x pishrink.sh
sudo mv pishrink.sh /usr/local/bin
sudo pishrink.sh ./pwnagotchi-raspios-lite-${{ env.VERSION }}.img
sudo sha256sum ./pwnagotchi-raspios-lite-${{ env.VERSION }}.img > ./pwnagotchi-raspios-lite-${{ env.VERSION }}-shrink.sha256
sudo pishrink.sh ./pwnagotchi-raspios-lite-${{ inputs.release_version }}.img
sudo sha256sum ./pwnagotchi-raspios-lite-${{ inputs.release_version }}.img > ./pwnagotchi-raspios-lite-${{ inputs.release_version }}-shrink.sha256

- uses: edgarrc/action-7z@v1
with:
args: 7z a -t7z -mx=9 pwnagotchi-raspios-lite-${{ env.VERSION }}-shrink.7z ./pwnagotchi-raspios-lite-${{ env.VERSION }}.sha256
args: ${{ inputs.z_compress_args }} pwnagotchi-raspios-lite-${{ inputs.release_version }}-shrink.7z ./pwnagotchi-raspios-lite-${{ inputs.release_version }}.img

- name: Create GitHub Release
id: create_new_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
tag_name: ${{ inputs.release_version }}
release_name: Release ${{ inputs.release_version }}
- name: Upload GitHub Release sha
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_new_release.outputs.upload_url }}
asset_path: ./pwnagotchi-raspios-lite-${{ env.VERSION }}.sha256
asset_name: pwnagotchi-v${{ env.VERSION }}.sha256
asset_path: ./pwnagotchi-raspios-lite-${{ inputs.release_version }}.sha256
asset_name: pwnagotchi-v${{ inputs.release_version }}.sha256
asset_content_type: appliction/text
- name: Upload GitHub Release Zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_new_release.outputs.upload_url }}
asset_path: ./pwnagotchi-raspios-lite-${{ env.VERSION }}-shrink.7z
asset_name: pwnagotchi-v${{ env.VERSION }}.7z
asset_path: ./pwnagotchi-raspios-lite-${{ inputs.release_version }}-shrink.7z
asset_name: pwnagotchi-v${{ inputs.release_version }}.7z
asset_content_type: appliction/zip