aboutsummaryrefslogtreecommitdiff
path: root/linux/home/.github/workflows/release.yml
blob: 0dcf4392179ea703d727794d56921e2614b85e45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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