Skip to content

Commit

Permalink
ci: automate Unix & Windows draft release merging (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
ixje authored Jan 19, 2024
1 parent 0445b4d commit aa28e28
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 10 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,16 @@ jobs:
args: release --clean --config .goreleaser.yaml
env:
GITHUB_TOKEN: ${{ secrets.GH_HOMEBREW_TAP }}
- uses: actions/cache@v3
env:
cache-name: cpm-dist
with:
path: ./dist
enableCrossOsArchive: true
key: dist-unix
goreleaser-windows:
runs-on: windows-latest
needs: goreleaser-unix
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -46,3 +54,47 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
- uses: actions/cache@v3
env:
cache-name: cpm-dist
with:
path: ./dist
enableCrossOsArchive: true
key: dist-windows
merge-dist:
runs-on: ubuntu-latest
needs: goreleaser-windows
steps:
- name: restore Unix dist cache
uses: actions/cache@v3
env:
cache-name: cpm-dist
with:
path: ./dist
enableCrossOsArchive: true
key: dist-unix
restore-keys: |
dist-unix
- name: restore Windows dist cache
uses: actions/cache@v3
env:
cache-name: cpm-dist
with:
path: ./dist
enableCrossOsArchive: true
key: dist-windows
restore-keys: |
dist-windows
- name: Remove unnecessary files before release
run: |
ls -la ./dist
rm -rf ./dist/*/
rm ./dist/config.yaml
rm ./dist/metadata.json
rm ./dist/checksums.txt
- name: Create draft release
uses: softprops/action-gh-release@v1
with:
draft: true
name: Draft
files: ./dist/*.*
5 changes: 0 additions & 5 deletions .goreleaser-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,3 @@ chocolateys:
api_key: '{{ .Env.CHOCOLATEY_API_KEY }}'
source_repo: "https://push.chocolatey.org/"
skip_publish: false

# Github release
release:
draft: true
replace_existing_draft: false
5 changes: 0 additions & 5 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ nfpms:
- rpm
- archlinux

# Github release
release:
draft: true
replace_existing_draft: false

# OSX homebrew tap
brews:
-
Expand Down

0 comments on commit aa28e28

Please sign in to comment.