aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/release.yml59
1 files changed, 59 insertions, 0 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..0dcf439
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,59 @@
+name: Create Release
+
+on:
+ push:
+ tags:
+ - 'v*' # This triggers the workflow on version tags
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Download dotfiles zip
+ run: |
+ mkdir -p $HOME/temp-dotfiles
+ cd $HOME/temp-dotfiles
+ echo "Downloading dotfiles-main.zip..."
+ curl -LOk https://github.com/srdusr/dotfiles/archive/main.zip
+ ls -lh main.zip # Log file size
+ unzip main.zip -d dotfiles-main
+ mv dotfiles-main/dotfiles-main dotfiles
+ ls -lh dotfiles # Log extracted files
+
+ - name: Create zip file
+ run: |
+ cd $HOME/temp-dotfiles
+ zip -r dotfiles.zip dotfiles
+
+ - name: Move zip file to home directory
+ run: |
+ mv /home/runner/temp-dotfiles/dotfiles.zip /home/runner/dotfiles.zip
+ ls -lh $HOME/dotfiles.zip # Verify existence after move (optional)
+
+ - name: Clean up
+ run: |
+ rm -rf $HOME/temp-dotfiles
+ echo $HOME
+
+ - name: Create GitHub Release
+ id: create_release
+ uses: actions/create-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: ${{ github.ref }}
+ release_name: Release ${{ github.ref }}
+ body: Automatically generated release
+ draft: false
+ prerelease: false
+
+ - name: Upload zip to release
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+ asset_path: /home/runner/dotfiles.zip
+ asset_name: dotfiles.zip
+ asset_content_type: application/zip