Skip to content
This repository was archived by the owner on Feb 4, 2024. It is now read-only.

Commit 8bfe451

Browse files
committed
🔖 release v1.1.0
1 parent 36b4de6 commit 8bfe451

File tree

5 files changed

+120
-25
lines changed

5 files changed

+120
-25
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Build package
22

33
on:
4-
push:
5-
tags:
6-
- 'v[0-9]+.[0-9]+.[0-9]+*'
4+
workflow_call:
5+
inputs:
6+
runs-on:
7+
description: 'The runner type'
8+
required: true
9+
type: string
710
defaults:
811
run:
912
shell: bash
@@ -14,10 +17,8 @@ permissions: read-all
1417
jobs:
1518
publish:
1619
name: "Build"
17-
runs-on: macos-latest
20+
runs-on: "${{ inputs.runs-on }}"
1821
environment: build
19-
permissions:
20-
contents: write
2122
env:
2223
GITHUB_REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }}
2324
steps:
@@ -155,21 +156,24 @@ jobs:
155156
run: |
156157
set -e
157158
rm -rf ./build/dist/workflow.zip
158-
- name: Create Alfred Workflow
159-
id: create_alfred_workflow
159+
- name: Compress artifacts
160+
id: compress_artifacts
160161
env:
161162
WORKFLOW_NAME: ${{ vars.WORKFLOW_NAME }}
163+
working-directory: build/dist
162164
run: |
163165
set -e
164-
pushd ./build/dist || exit 1
165-
find . -not -path "./*_cache*" -exec zip --symlinks "../${WORKFLOW_NAME}-v${VERSION}.alfredworkflow" {} +
166-
popd || exit 1
167-
echo "artifactPath=build/${WORKFLOW_NAME}-v${VERSION}.alfredworkflow" >> $GITHUB_ENV
168-
- name: Release
169-
id: release_workflow
170-
uses: softprops/action-gh-release@v1
166+
ARTIFACT_NAME=${WORKFLOW_NAME}-v${VERSION}-$(uname -m)
167+
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
168+
find . -not -path "./*_cache*" -exec zip --symlinks "../${ARTIFACT_NAME}.zip" {} +
169+
echo "ARTIFACT_PATH=build/${ARTIFACT_NAME}.zip" >> $GITHUB_ENV
170+
- name: Artifact
171+
id: success_artifact
172+
uses: actions/upload-artifact@v4
171173
with:
172-
files: ${{ env.artifactPath }}
174+
name: ${{ env.ARTIFACT_NAME }}
175+
path: ${{ env.ARTIFACT_PATH }}
176+
retention-days: 1
173177
- name: Clean up keychain and build directory
174178
id: clean_up
175179
if: ${{ always() }}

.github/workflows/release.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Release package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
7+
defaults:
8+
run:
9+
shell: bash
10+
env:
11+
PUB_ENVIRONMENT: bot.github
12+
permissions: read-all
13+
14+
jobs:
15+
build:
16+
name: "Build"
17+
strategy:
18+
matrix:
19+
os: [macos-14, macos-12]
20+
fail-fast: true
21+
uses: ./.github/workflows/build.yml
22+
with:
23+
runs-on: ${{ matrix.os }}
24+
secrets: inherit
25+
github_release:
26+
name: "Github Release"
27+
needs: build
28+
environment: build
29+
runs-on: ubuntu-latest
30+
permissions:
31+
contents: write
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Read pubspec.yaml version
35+
id: read_pubspec_version
36+
run: |
37+
set -e
38+
VERSION=$(yq -r '.version' pubspec.yaml)
39+
echo "VERSION=$VERSION" >> $GITHUB_ENV
40+
- name: Get arm64 artifact
41+
id: download_arm64_artifact
42+
uses: actions/download-artifact@v4
43+
env:
44+
WORKFLOW_NAME: ${{ vars.WORKFLOW_NAME }}
45+
ARCH: arm64
46+
with:
47+
name: ${{ env.WORKFLOW_NAME }}-v${{ env.VERSION }}-${{ env.ARCH }}
48+
path: ${{ runner.temp }}/download
49+
- name: Get x86_64 artifact
50+
id: download_x86_64_artifact
51+
uses: actions/download-artifact@v4
52+
env:
53+
WORKFLOW_NAME: ${{ vars.WORKFLOW_NAME }}
54+
ARCH: x86_64
55+
with:
56+
name: ${{ env.WORKFLOW_NAME }}-v${{ env.VERSION }}-${{ env.ARCH }}
57+
path: ${{ runner.temp }}/download
58+
- name: Unzip artifacts
59+
env:
60+
WORKFLOW_NAME: ${{ vars.WORKFLOW_NAME }}
61+
id: unzip_artifacts
62+
working-directory: ${{ runner.temp }}/download
63+
run: |
64+
set -e
65+
for ARCH in "arm64" "x86_64"; do
66+
mkdir -p $ARCH
67+
unzip -q ${{ env.WORKFLOW_NAME }}-v${{ env.VERSION }}-${ARCH}.zip -d $ARCH
68+
done
69+
- name: Create Alfred Workflow
70+
id: create_alfred_workflow
71+
env:
72+
WORKFLOW_NAME: ${{ vars.WORKFLOW_NAME }}
73+
working-directory: ${{ runner.temp }}/download
74+
run: |
75+
set -e
76+
mv x86_64/workflow arm64/workflow_intel
77+
pushd arm64
78+
find . -not -path "./*_cache*" -exec zip --symlinks "../${WORKFLOW_NAME}-v${VERSION}.alfredworkflow" {} +
79+
popd
80+
- name: Release
81+
id: release_workflow
82+
env:
83+
WORKFLOW_NAME: ${{ vars.WORKFLOW_NAME }}
84+
uses: softprops/action-gh-release@v1
85+
with:
86+
files: ${{ runner.temp }}/download/${{ env.WORKFLOW_NAME }}-v${{ env.VERSION }}.alfredworkflow
87+
- name: Clean up
88+
id: clean_up
89+
if: ${{ always() }}
90+
run: |
91+
rm -rf $RUNNER_TEMP/download

info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<key>escaping</key>
6666
<integer>102</integer>
6767
<key>script</key>
68-
<string>arch -x86_64 ./workflow -u</string>
68+
<string>[ "$(uname -m)" = "arm64" ] &amp;&amp; ./workflow -u || ./workflow_intel -u</string>
6969
<key>scriptargtype</key>
7070
<integer>1</integer>
7171
<key>scriptfile</key>
@@ -108,7 +108,7 @@
108108
<key>runningsubtext</key>
109109
<string>Fetching StackOverflow questions ...</string>
110110
<key>script</key>
111-
<string>arch -x86_64 ./workflow -q "{query}"</string>
111+
<string>[ "$(uname -m)" = "arm64" ] &amp;&amp; ./workflow -q "{query}" || ./workflow_intel -q "{query}"</string>
112112
<key>scriptargtype</key>
113113
<integer>0</integer>
114114
<key>scriptfile</key>

pubspec.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ packages:
55
dependency: transitive
66
description:
77
name: _fe_analyzer_shared
8-
sha256: "0f7b1783ddb1e4600580b8c00d0ddae5b06ae7f0382bd4fcce5db4df97b618e1"
8+
sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
99
url: "https://pub.dev"
1010
source: hosted
11-
version: "66.0.0"
11+
version: "67.0.0"
1212
alfred_workflow:
1313
dependency: "direct main"
1414
description:
@@ -21,10 +21,10 @@ packages:
2121
dependency: transitive
2222
description:
2323
name: analyzer
24-
sha256: "5e8bdcda061d91da6b034d64d8e4026f355bcb8c3e7a0ac2da1523205a91a737"
24+
sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
2525
url: "https://pub.dev"
2626
source: hosted
27-
version: "6.4.0"
27+
version: "6.4.1"
2828
args:
2929
dependency: "direct main"
3030
description:
@@ -109,10 +109,10 @@ packages:
109109
dependency: transitive
110110
description:
111111
name: build_runner_core
112-
sha256: c9e32d21dd6626b5c163d48b037ce906bbe428bc23ab77bcd77bb21e593b6185
112+
sha256: "4ae8ffe5ac758da294ecf1802f2aff01558d8b1b00616aa7538ea9a8a5d50799"
113113
url: "https://pub.dev"
114114
source: hosted
115-
version: "7.2.11"
115+
version: "7.3.0"
116116
built_collection:
117117
dependency: transitive
118118
description:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Search for answers on StackOverflow from Alfred
44
# Prevent accidental publishing to pub.dev.
55
publish_to: 'none'
66

7-
version: 1.0.7
7+
version: 1.1.0
88

99
environment:
1010
sdk: '>=3.2.0 <4.0.0'

0 commit comments

Comments
 (0)