fork/glide

git clone https://git.julia.blue/fork/glide

Tyler Mandrychore: Enable CI package uploada231167

v0.1.1
3.3 KiB106 linesraw
1name: Package
2
3on:
4  push:
5    tags:
6      - "v*.*.*"
7    branches:
8      - main
9
10env:
11  CARGO_INCREMENTAL: 0
12  CARGO_NET_RETRY: 10
13  CARGO_TERM_COLOR: always
14  RUST_BACKTRACE: 1
15  RUSTUP_MAX_RETRIES: 10
16
17jobs:
18  package:
19    runs-on: macos-15
20    permissions:
21      contents: write
22
23    steps:
24      - name: Install cargo-packager
25        uses: taiki-e/cache-cargo-install-action@v2
26        with:
27          tool: cargo-packager@0.11.8
28
29      - name: Install parse-changelog
30        uses: taiki-e/cache-cargo-install-action@v2
31        with:
32          tool: parse-changelog@0.6.14
33
34      - uses: actions/checkout@v4
35        with:
36          persist-credentials: false
37
38      # release-please normally parses the pull request description for release notes.
39      # Instead of having two sources of truth, get them from the changelog.
40      #
41      # The workflow still isn't perfect because release-please can overwrite
42      # the PR if new changes land, but it's good enough for now.
43      - name: Parse changelog
44        if: github.ref_type == 'tag'
45        run: |
46          GLIDE_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "glide-wm") | .version')
47          parse-changelog CHANGELOG.md $GLIDE_VERSION > CHANGELOG_version.md
48
49      - name: Install latest stable
50        run: |
51          rustup update stable
52          rustup target add aarch64-apple-darwin
53          rustup target add x86_64-apple-darwin
54
55      - name: Build
56        run: |
57          cargo build --release --verbose --locked --target aarch64-apple-darwin
58          cargo build --release --verbose --locked --target x86_64-apple-darwin
59
60      - name: Import code-signing certificates
61        uses: apple-actions/import-codesign-certs@v3
62        with:
63          p12-file-base64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
64          p12-password: ${{ secrets.P12_PASSWORD }}
65
66      - name: Import notarization API key
67        if: github.ref_type == 'tag'
68        env:
69          APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
70        run: |
71          echo "$APPLE_API_KEY_BASE64" | base64 --decode > AuthKey.p8
72
73      - name: Package, sign, and notarize
74        env:
75          APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
76          APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
77          APPLE_API_KEY_PATH: AuthKey.p8
78        run: |
79          if [[ "${{ github.ref_type }}" != "tag" ]]; then
80            # Disable notarization.
81            unset APPLE_API_KEY
82            unset APPLE_API_ISSUER
83          fi
84          # For debugging; should show the signing identity
85          security find-identity -v -p codesigning
86          # Package, sign, and notarize
87          cargo packager --release --target aarch64-apple-darwin
88          cargo packager --release --target x86_64-apple-darwin
89
90      - uses: actions/upload-artifact@v4
91        with:
92          path: target/*-apple-darwin/release/Glide_*.dmg
93
94      - name: Release
95        uses: softprops/action-gh-release@v2
96        if: github.ref_type == 'tag'
97        with:
98          files: |
99            target/aarch64-apple-darwin/release/Glide_*.dmg
100            target/x86_64-apple-darwin/release/Glide_*.dmg
101          fail_on_unmatched_files: true
102          body_path: CHANGELOG_version.md
103          # To keep release-please's notes, comment the line above and uncomment
104          # these lines:
105          # body: ""
106          # append_body: true