Skip to content

Commit

Permalink
🔖 release v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
techouse committed Feb 3, 2024
1 parent 07a2142 commit 8aead99
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 17 deletions.
33 changes: 19 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Build package

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
workflow_call:
inputs:
runs-on:
description: 'The runner type'
required: true
type: string
defaults:
run:
shell: bash
Expand All @@ -14,10 +17,8 @@ permissions: read-all
jobs:
publish:
name: "Build"
runs-on: macos-latest
runs-on: "${{ inputs.runs-on }}"
environment: build
permissions:
contents: write
env:
GITHUB_REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }}
steps:
Expand Down Expand Up @@ -155,20 +156,24 @@ jobs:
run: |
set -e
rm -rf build/dist/workflow.zip
- name: Create Alfred Workflow
id: create_alfred_workflow
- name: Compress artifacts
id: compress_artifacts
env:
WORKFLOW_NAME: ${{ vars.WORKFLOW_NAME }}
working-directory: build/dist
run: |
set -e
find . -not -path "./*_cache*" -exec zip --symlinks "../${WORKFLOW_NAME}-v${VERSION}.alfredworkflow" {} +
echo "artifactPath=build/${WORKFLOW_NAME}-v${VERSION}.alfredworkflow" >> $GITHUB_ENV
- name: Release
id: release_workflow
uses: softprops/action-gh-release@v1
ARTIFACT_NAME=${WORKFLOW_NAME}-v${VERSION}-$(uname -m)
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
find . -not -path "./*_cache*" -exec zip --symlinks "../${ARTIFACT_NAME}.zip" {} +
echo "ARTIFACT_PATH=build/${ARTIFACT_NAME}.zip" >> $GITHUB_ENV
- name: Artifact
id: success_artifact
uses: actions/upload-artifact@v4
with:
files: ${{ env.artifactPath }}
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_PATH }}
retention-days: 1
- name: Clean up keychain and build directory
id: clean_up
if: ${{ always() }}
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Release package

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
defaults:
run:
shell: bash
env:
PUB_ENVIRONMENT: bot.github
permissions: read-all

jobs:
build:
name: "Build"
strategy:
matrix:
os: [macos-14, macos-12]
fail-fast: true
uses: ./.github/workflows/build.yml
with:
runs-on: ${{ matrix.os }}
secrets: inherit
github_release:
name: "Github Release"
needs: build
environment: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Read pubspec.yaml version
id: read_pubspec_version
run: |
set -e
VERSION=$(yq -r '.version' pubspec.yaml)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Get arm64 artifact
id: download_arm64_artifact
uses: actions/download-artifact@v4
env:
WORKFLOW_NAME: ${{ vars.WORKFLOW_NAME }}
ARCH: arm64
with:
name: ${{ env.WORKFLOW_NAME }}-v${{ env.VERSION }}-${{ env.ARCH }}
path: ${{ runner.temp }}/download
- name: Get x86_64 artifact
id: download_x86_64_artifact
uses: actions/download-artifact@v4
env:
WORKFLOW_NAME: ${{ vars.WORKFLOW_NAME }}
ARCH: x86_64
with:
name: ${{ env.WORKFLOW_NAME }}-v${{ env.VERSION }}-${{ env.ARCH }}
path: ${{ runner.temp }}/download
- name: Unzip artifacts
env:
WORKFLOW_NAME: ${{ vars.WORKFLOW_NAME }}
id: unzip_artifacts
working-directory: ${{ runner.temp }}/download
run: |
set -e
for ARCH in "arm64" "x86_64"; do
mkdir -p $ARCH
unzip -q ${{ env.WORKFLOW_NAME }}-v${{ env.VERSION }}-${ARCH}.zip -d $ARCH
done
- name: Create Alfred Workflow
id: create_alfred_workflow
env:
WORKFLOW_NAME: ${{ vars.WORKFLOW_NAME }}
working-directory: ${{ runner.temp }}/download
run: |
set -e
mv x86_64/workflow arm64/workflow_intel
pushd arm64
find . -not -path "./*_cache*" -exec zip --symlinks "../${WORKFLOW_NAME}-v${VERSION}.alfredworkflow" {} +
popd
- name: Release
id: release_workflow
env:
WORKFLOW_NAME: ${{ vars.WORKFLOW_NAME }}
uses: softprops/action-gh-release@v1
with:
files: ${{ runner.temp }}/download/${{ env.WORKFLOW_NAME }}-v${{ env.VERSION }}.alfredworkflow
- name: Clean up keychain and build directory
id: clean_up
if: ${{ always() }}
run: |
rm -rf $RUNNER_TEMP/download
4 changes: 2 additions & 2 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<key>escaping</key>
<integer>102</integer>
<key>script</key>
<string>arch -x86_64 ./workflow -u</string>
<string>[ "$(uname -m)" = "arm64" ] &amp;&amp; ./workflow -u || ./workflow_intel -u</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -108,7 +108,7 @@
<key>runningsubtext</key>
<string>Fetching the documentation ...</string>
<key>script</key>
<string>arch -x86_64 ./workflow -q "{query}"</string>
<string>[ "$(uname -m)" = "arm64" ] &amp;&amp; ./workflow -q "{query}" || ./workflow_intel -q "{query}"</string>
<key>scriptargtype</key>
<integer>0</integer>
<key>scriptfile</key>
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Search the Tailwind CSS documentation using Alfred
# Prevent accidental publishing to pub.dev.
publish_to: 'none'

version: 2.1.16
version: 2.2.0

environment:
sdk: '>=3.2.0 <4.0.0'
Expand Down

0 comments on commit 8aead99

Please sign in to comment.