Skip to content

Commit

Permalink
ci: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Divkix committed Aug 9, 2024
1 parent f1396a9 commit 3163f4a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 56 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,25 @@ on:
jobs:
ci:
name: Goreleaser CI
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Configure git
run: git config --global url."https://celestix:${{ secrets.GH_PAT }}@github.com".insteadOf "https://github.com"
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "stable"
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --snapshot --skip-publish --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
args: release --snapshot --skip=publish --clean --skip=sign
- name: Tar files
run: tar -czvf artifacts.tar.gz dist/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
path: artifacts.tar.gz
59 changes: 23 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,31 @@ on:
description: "Snap release channel"
required: false
type: choice
default: 'edge'
default: "edge"
options:
- stable
- candidate
- beta
- edge
- stable
- candidate
- beta
- edge

jobs:
ci:
name: Goreleaser CI
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Configure git
run: git config --global url."https://celestix:${GITHUB_TOKEN}@github.com".insteadOf "https://github.com"
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "stable"
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --snapshot --skip=publish --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
args: release --snapshot --skip=publish --clean --skip=sign

update-install-script:
name: Update scripts/install.sh in warp-releases
Expand Down Expand Up @@ -87,8 +75,8 @@ jobs:
mkdir -p ./warp-releases/keys/ && cp ./warpdl/keys/key.gpg ./warp-releases/keys/key.gpg
- name: Commit changes
run: |-
git config --global user.email "[email protected]"
git config --global user.name "celestix"
git config --global user.email "[email protected]"
git config --global user.name "Divanshu Chauhan"
cd warp-releases && git add . && git commit -m "bump to ${{ env.RELEASE_VERSION }}"
cd ..
cd warpdl && git add . && git commit -m "bump to ${{ env.RELEASE_VERSION }}"
Expand All @@ -113,11 +101,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
steps:
- name: Set up git
run: git config --global url."https://celestix:${GITHUB_TOKEN}@github.com".insteadOf "https://github.com"
run: git config --global url."https://divkix:${GITHUB_TOKEN}@github.com".insteadOf "https://github.com"
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "stable"
- name: Install UPX
Expand All @@ -128,16 +116,16 @@ jobs:
- if: startsWith(github.ref, 'refs/tags/') != 'true' && github.event.inputs.tag != ''
name: Create and Push Tag
run: |-
git config --global user.email "[email protected]"
git config --global user.name "celestix"
git config --global user.email "[email protected]"
git config --global user.name "Divanshu Chauhan"
tag=${{ github.event.inputs.tag }} # if triggered by workflow_dispatch
if [ -z "$tag" ]; then
tag=${GITHUB_REF#refs/tags/}
fi
git tag -f -a -m "$tag" "$tag"
git push -f origin "$tag"
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -148,18 +136,18 @@ jobs:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Push to fury
run: |-
./scripts/gemfury/push.sh
env:
GEMFURY_PUSH_KEY: ${{ secrets.GEMFURY_PUSH_KEY }}
# - name: Push to fury
# run: |-
# ./scripts/gemfury/push.sh
# env:
# GEMFURY_PUSH_KEY: ${{ secrets.GEMFURY_PUSH_KEY }}

snapcraft:
name: Publish snaps
Expand All @@ -170,9 +158,9 @@ jobs:
strategy:
matrix:
platform:
- i386
- amd64
- arm64
- i386
- amd64
- arm64
steps:
- uses: docker/setup-qemu-action@v2
- name: Checkout
Expand All @@ -189,7 +177,6 @@ jobs:
with:
snap: ${{ steps.build.outputs.snap }}
release: ${{ github.event.inputs.snap_channel }}

# run-tests:
# name: Run test scripts
# runs-on: ubuntu-latest
Expand Down
12 changes: 8 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json

version: 2

project_name: warpdl

release:
Expand Down Expand Up @@ -57,8 +61,8 @@ builds:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X main.BuildType=stable

archives:
- rlcp: true
name_template: >-
# - rlcp: true
- name_template: >-
{{ .ProjectName }}_
{{- .Version }}_
{{- if eq .Os "darwin" }}macOS
Expand Down Expand Up @@ -114,7 +118,7 @@ brews:
commit_author:
name: "Divkix"
email: [email protected]
folder: Formula
directory: Formula
homepage: "https://warpdl.org"
description: "The official Warp CLI download manager"
install: |-
Expand Down Expand Up @@ -157,7 +161,7 @@ nfpms:
# publish: false
# summary: An ultra fast download manager
# description: |-
# Warp is a powerful and versatile cross-platform download manager.
# Warp is a powerful and versatile cross-platform download manager.
# With its advanced technology, Warp has the ability to accelerate
# your download speeds by up to 10 times, revolutionizing the way
# you obtain files on any operating system.
Expand Down

0 comments on commit 3163f4a

Please sign in to comment.