chore: Updated action a08e1a91
stevedylandev · 2025-07-09 19:42 1 file(s) · +27 −44
.github/workflows/release.yaml +27 −44
16 16
    steps:
17 17
      - name: Create Release
18 18
        id: create_release
19 -
        uses: actions/create-release@v1
19 +
        uses: softprops/action-gh-release@v1
20 20
        env:
21 21
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 22
        with:
23 23
          tag_name: ${{ github.ref }}
24 -
          release_name: Release ${{ github.ref }}
24 +
          name: Release ${{ github.ref }}
25 25
          draft: false
26 26
          prerelease: false
27 27
47 47
            asset_name: walletfetch-windows-x86_64.exe
48 48
    runs-on: ${{ matrix.os }}
49 49
    steps:
50 -
      - uses: actions/checkout@v3
50 +
      - uses: actions/checkout@v4
51 51
52 52
      - name: Install Rust
53 -
        uses: actions-rs/toolchain@v1
53 +
        uses: dtolnay/rust-toolchain@stable
54 54
        with:
55 -
          toolchain: stable
56 -
          target: ${{ matrix.target }}
57 -
          override: true
55 +
          targets: ${{ matrix.target }}
58 56
59 57
      - name: Install musl-tools (Linux musl only)
60 58
        if: matrix.target == 'x86_64-unknown-linux-musl'
61 59
        run: sudo apt-get update && sudo apt-get install -y musl-tools
62 60
63 61
      - name: Build
64 -
        uses: actions-rs/cargo@v1
65 -
        with:
66 -
          command: build
67 -
          args: --release --target ${{ matrix.target }}
62 +
        run: cargo build --release --target ${{ matrix.target }}
68 63
69 64
      - name: Create archive (Unix)
70 65
        if: matrix.os != 'windows-latest'
71 66
        run: |
72 67
          cd target/${{ matrix.target }}/release
73 -
          tar czf ../../../${{ matrix.asset_name }}.tar.gz your-app-binary-name
68 +
          tar czf ../../../${{ matrix.asset_name }}.tar.gz walletfetch
74 69
75 70
      - name: Create archive (Windows)
76 71
        if: matrix.os == 'windows-latest'
77 72
        run: |
78 73
          cd target/${{ matrix.target }}/release
79 -
          7z a ../../../${{ matrix.asset_name }}.zip your-app-binary-name.exe
74 +
          7z a ../../../${{ matrix.asset_name }}.zip walletfetch.exe
80 75
81 76
      - name: Upload Release Asset (Unix)
82 77
        if: matrix.os != 'windows-latest'
83 -
        uses: actions/upload-release-asset@v1
78 +
        uses: softprops/action-gh-release@v1
84 79
        env:
85 80
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86 81
        with:
87 -
          upload_url: ${{ needs.create-release.outputs.upload_url }}
88 -
          asset_path: ./${{ matrix.asset_name }}.tar.gz
89 -
          asset_name: ${{ matrix.asset_name }}.tar.gz
90 -
          asset_content_type: application/gzip
82 +
          tag_name: ${{ github.ref }}
83 +
          files: ./${{ matrix.asset_name }}.tar.gz
91 84
92 85
      - name: Upload Release Asset (Windows)
93 86
        if: matrix.os == 'windows-latest'
94 -
        uses: actions/upload-release-asset@v1
87 +
        uses: softprops/action-gh-release@v1
95 88
        env:
96 89
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97 90
        with:
98 -
          upload_url: ${{ needs.create-release.outputs.upload_url }}
99 -
          asset_path: ./${{ matrix.asset_name }}.zip
100 -
          asset_name: ${{ matrix.asset_name }}.zip
101 -
          asset_content_type: application/zip
91 +
          tag_name: ${{ github.ref }}
92 +
          files: ./${{ matrix.asset_name }}.zip
102 93
103 94
  publish-crates:
104 95
    needs: build-and-upload
105 96
    runs-on: ubuntu-latest
106 97
    steps:
107 -
      - uses: actions/checkout@v3
98 +
      - uses: actions/checkout@v4
108 99
109 100
      - name: Install Rust
110 -
        uses: actions-rs/toolchain@v1
111 -
        with:
112 -
          toolchain: stable
113 -
          override: true
101 +
        uses: dtolnay/rust-toolchain@stable
114 102
115 103
      - name: Publish to crates.io
116 -
        uses: actions-rs/cargo@v1
117 -
        with:
118 -
          command: publish
119 -
          args: --token ${{ secrets.CRATES_TOKEN }}
104 +
        run: cargo publish --token ${{ secrets.CRATES_TOKEN }}
120 105
121 106
  update-homebrew:
122 107
    needs: build-and-upload
123 108
    runs-on: ubuntu-latest
124 109
    steps:
125 -
      - uses: actions/checkout@v3
110 +
      - uses: actions/checkout@v4
126 111
127 112
      - name: Get release info
128 113
        id: get_release
145 130
146 131
          # Update the formula
147 132
          cat > Formula/walletfetch.rb << EOF
148 -
          class YourApp < Formula
133 +
          class Walletfetch < Formula
149 134
            desc "Like Neofetch, but for your wallet"
150 135
            homepage "https://github.com/stevedylandev/walletfetch"
151 136
            url "https://github.com/${{ github.repository }}/releases/download/${{ steps.get_release.outputs.tag_name }}/walletfetch-macos-x86_64.tar.gz"
173 158
    needs: build-and-upload
174 159
    runs-on: ubuntu-latest
175 160
    steps:
176 -
      - uses: actions/checkout@v3
161 +
      - uses: actions/checkout@v4
177 162
178 163
      - name: Generate install script
179 164
        run: |
189 174
          case $OS in
190 175
              linux)
191 176
                  case $ARCH in
192 -
                      x86_64) BINARY="your-app-linux-x86_64" ;;
177 +
                      x86_64) BINARY="walletfetch-linux-x86_64" ;;
193 178
                      *) echo "Unsupported architecture: $ARCH"; exit 1 ;;
194 179
                  esac
195 180
                  ;;
196 181
              darwin)
197 182
                  case $ARCH in
198 -
                      x86_64) BINARY="your-app-macos-x86_64" ;;
199 -
                      arm64) BINARY="your-app-macos-aarch64" ;;
183 +
                      x86_64) BINARY="walletfetch-macos-x86_64" ;;
184 +
                      arm64) BINARY="walletfetch-macos-aarch64" ;;
200 185
                      *) echo "Unsupported architecture: $ARCH"; exit 1 ;;
201 186
                  esac
202 187
                  ;;
223 208
          mv /tmp/walletfetch "$INSTALL_DIR/"
224 209
          chmod +x "$INSTALL_DIR/walletfetch"
225 210
226 -
          echo "your-app installed to $INSTALL_DIR/walletfetch"
211 +
          echo "walletfetch installed to $INSTALL_DIR/walletfetch"
227 212
          echo "Make sure $INSTALL_DIR is in your PATH"
228 213
          EOF
229 214
230 215
          chmod +x scripts/install.sh
231 216
232 217
      - name: Upload install script
233 -
        uses: actions/upload-release-asset@v1
218 +
        uses: softprops/action-gh-release@v1
234 219
        env:
235 220
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
236 221
        with:
237 -
          upload_url: ${{ needs.create-release.outputs.upload_url }}
238 -
          asset_path: ./scripts/install.sh
239 -
          asset_name: install.sh
240 -
          asset_content_type: text/plain
222 +
          tag_name: ${{ github.ref }}
223 +
          files: ./scripts/install.sh