Skip to content

Commit

Permalink
refactor(GithubAction): Add Gallery version
Browse files Browse the repository at this point in the history
- remove auto update Github version
  • Loading branch information
cage1016 committed Sep 8, 2023
1 parent f81e771 commit f2af283
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 114 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Gallery Release
on:
release:
types:
Expand All @@ -13,6 +13,9 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Parse Event
run: |
echo "tag=$(jq -r '.release.tag_name' "${GITHUB_EVENT_PATH}" | sed s/^v//)" >> $GITHUB_ENV
- name: Install Go
if: success()
uses: actions/setup-go@v2
Expand All @@ -22,10 +25,23 @@ jobs:
run: go test -v -race -cover -coverprofile coverage.txt -covermode=atomic ./...
- name: update codecov
run: |
CODECOV_TOKEN="${{ secrets.CODECOV_TOKEN }}" bash <(curl -s https://codecov.io/bash)
- name: Parse Event
CODECOV_TOKEN="${{ secrets.CODECOV_TOKEN }}" bash <(curl -s https://codecov.io/bash)
- name: Build and pack
run: |
echo "tag=$(jq -r '.release.tag_name' "${GITHUB_EVENT_PATH}" | sed s/^v//)" >> $GITHUB_ENV
# build package
GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X github.com/cage1016/alfred-devtoys/cmd.EnabledAutoUpdate=false" -o exe_amd64
GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X github.com/cage1016/alfred-devtoys/cmd.EnabledAutoUpdate=false" -o exe_arm64
lipo -create -output .workflow/exe exe_amd64 exe_arm64
rm exe_amd64
rm exe_arm64
# pack
cd .workflow
plutil -replace version -string "${{ env.tag }}" info.plist
zip -r ../"DevToys_GALLERY-${{ env.tag }}.alfredworkflow" .
cd ..
echo "artifact=$(echo "DevToys_GALLERY-${{ env.tag }}.alfredworkflow")" >> $GITHUB_ENV
- name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v1
with:
Expand All @@ -37,14 +53,6 @@ jobs:
run: |
brew tap mitchellh/gon
brew install mitchellh/gon/gon
- name: Build and pack
run: |
# build package
GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X github.com/cage1016/alfred-devtoys/cmd.EnabledAutoUpdate=false" -o exe_amd64
GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X github.com/cage1016/alfred-devtoys/cmd.EnabledAutoUpdate=false" -o exe_arm64
lipo -create -output .workflow/exe exe_amd64 exe_arm64
rm exe_amd64
rm exe_arm64
- name: code sign and notarize
env:
AC_USERNAME: "${{ secrets.AC_USERNAME }}"
Expand All @@ -61,29 +69,29 @@ jobs:
}
EOF
gon -log-level=debug -log-json ./gon.json
# pack alfredworkflow
cd .workflow
plutil -replace version -string "${{ env.tag }}" info.plist
zip -r ../"DevToys-${{ env.tag }}.alfredworkflow_" .
zip -r ../"DevToys_GALLERY-${{ env.tag }}.alfredworkflow" .
cd ..
# zip alfredworkflow as zip archive for notarize
zip -r "DevToys-${{ env.tag }}.alfredworkflow.zip" "DevToys-${{ env.tag }}.alfredworkflow_"
zip -r "DevToys_GALLERY-${{ env.tag }}.alfredworkflow.zip" "DevToys_GALLERY-${{ env.tag }}.alfredworkflow"
# gon notarize
cat <<EOF >> notarize.json
{
"notarize": [{
"path": "${PWD}/DevToys-${{ env.tag }}.alfredworkflow.zip",
"path": "${PWD}/DevToys_GALLERY-${{ env.tag }}.alfredworkflow.zip",
"bundle_id": "com.kaichu.devtoys",
"staple": false
}]
}
EOF
gon -log-level=debug -log-json ./notarize.json
echo "artifact=$(echo "DevToys-${{ env.tag }}.alfredworkflow_")" >> $GITHUB_ENV
echo "artifact=$(echo "DevToys_GALLERY-${{ env.tag }}.alfredworkflow")" >> $GITHUB_ENV
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
Expand Down
90 changes: 0 additions & 90 deletions .github/workflows/release_auto_update.yml

This file was deleted.

6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v1.7.3](https://github.com/cage1016/alfred-devtoys/compare/v1.7.2...v1.7.3)

> 3 September 2023
> 8 September 2023
- refactor(case): rewrite [`#15`](https://github.com/cage1016/alfred-devtoys/pull/15)
- prepare CHANGELOG for next releae [`f81e771`](https://github.com/cage1016/alfred-devtoys/commit/f81e771f7c83f6d00f0667ccc2431c92c5c56e7f)
- refactor(GithubAction): Add Gallery version [`45b8b4c`](https://github.com/cage1016/alfred-devtoys/commit/45b8b4c1b27beacfbdbb5185016996ac991bf9f6)
- refactor(githubaction): add auto update release [`7939786`](https://github.com/cage1016/alfred-devtoys/commit/7939786997dab21794fa004a67f5e8a079bb6752)
- refactor: remove update feature from root command [`29425bd`](https://github.com/cage1016/alfred-devtoys/commit/29425bdac7f4f49156a1dcf34c80f19f12e995f4)
- refactor(build): add Makefile, ak.json add gon [`c1aa56b`](https://github.com/cage1016/alfred-devtoys/commit/c1aa56bed5e5813737e6bfb5fb3f630d1b7e2418)

#### [v1.7.2](https://github.com/cage1016/alfred-devtoys/compare/v1.7.1...v1.7.2)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A Swiss Army knife for developers for Alfred

[![Release](https://github.com/cage1016/alfred-devtoys/actions/workflows/release.yml/badge.svg)](https://github.com/cage1016/alfred-devtoys/actions/workflows/release.yml)[![Release_auto_update](https://github.com/cage1016/alfred-devtoys/actions/workflows/release_auto_update.yml/badge.svg)](https://github.com/cage1016/alfred-devtoys/actions/workflows/release_auto_update.yml)
[![Gallery Release](https://github.com/cage1016/alfred-devtoys/actions/workflows/release-gallery.yml/badge.svg)](https://github.com/cage1016/alfred-devtoys/actions/workflows/release-gallery.yml)
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
![GitHub all releases](https://img.shields.io/github/downloads/cage1016/alfred-devtoys/total)
[![codecov](https://codecov.io/gh/cage1016/alfred-devtoys/branch/master/graph/badge.svg)](https://codecov.io/gh/cage1016/alfred-devtoys)
Expand Down

0 comments on commit f2af283

Please sign in to comment.