Build and Package Chrome Extension app #47
Workflow file for this run
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
name: Build and Package Chrome Extension app | |
on: | |
release: | |
types: | |
- created | |
jobs: | |
build-chrome-extension: | |
if: contains(github.event.release.tag_name, 'chrome') || (!contains(github.event.release.tag_name, 'linux') && !contains(github.event.release.tag_name, 'windows') && !contains(github.event.release.tag_name, 'chrome')) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "21.2" | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: "stable" | |
flutter-version: "3.24.5" | |
- run: flutter --version | |
- name: Install Flutter dependencies | |
run: flutter pub get | |
- name: Build Chrome Extension | |
run: bash ./scripts/build_chrome_extension.sh | |
- name: Get Version from pubspec.yaml | |
id: get_version | |
run: | | |
version_str=$(grep -oP '(?<=^version: ).*' pubspec.yaml | awk '{$1=$1};1') | |
echo "version_app=${version_str}" >> $GITHUB_OUTPUT | |
echo "env_version_app=${version_str}" >> $GITHUB_ENV | |
- name: List build directory contents for debugging | |
run: ls -R build | |
- name: Check build directory exists | |
run: | | |
echo "Current working directory: $(pwd)" | |
echo "Contents of current directory:" | |
ls -la | |
if [ ! -d "build/chrome-extension" ]; then | |
echo "Error: build/chrome-extension directory does not exist." | |
find . -type d -name "chrome-extension" | |
exit 1 | |
else | |
echo "build/chrome-extension directory exists." | |
ls build/chrome-extension | |
fi | |
- name: Install 7z | |
run: sudo apt-get install -y p7zip-full | |
- name: Zip build folder | |
run: | | |
echo "Creating zip file..." | |
(cd chrome-extension; 7z a -tzip ../../archethic-wallet-chrome-extension-${{ steps.get_version.outputs.version_app }}.zip ./) | |
working-directory: build | |
- name: Upload artifact to action | |
uses: actions/upload-artifact@v4 | |
with: | |
name: archethic-wallet-chrome-extension-${{ steps.get_version.outputs.version_app }} | |
path: archethic-wallet-chrome-extension-${{ steps.get_version.outputs.version_app }}.zip | |
- name: Upload artifact to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: archethic-wallet-chrome-extension-${{ steps.get_version.outputs.version_app }}.zip |