Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rocktavious authored Oct 22, 2022
1 parent 698af57 commit 27ea5c6
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,39 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
token: ${{ secrets.ORG_GITHUB_TOKEN }}
- name: Fetch All Tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Import GPG Key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Set Release Version
id: version
run: |
echo "::set-output name=RELEASE_VERSION::$(date +v%Y.%-m.%-d)"
- name: Ensure Release Does Not Exist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release delete ${{ steps.version.outputs.RELEASE_VERSION }} || true
- name: Set Package Version
run: |
cat << EOF > version.go
Expand All @@ -48,24 +68,14 @@ jobs:
fi
git tag -f ${{ steps.version.outputs.RELEASE_VERSION }} -m "Cut Release '${{ steps.version.outputs.RELEASE_VERSION }}'"
git push -f origin refs/tags/${{ steps.version.outputs.RELEASE_VERSION }}
- name: Ensure Release Does Not Exist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release delete ${{ steps.version.outputs.RELEASE_VERSION }} || true
- name: Import GPG Key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/[email protected]
with:
args: release --rm-dist --release-notes=./.changes/${{ steps.version.outputs.RELEASE_VERSION }}.md
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_TOKEN }}
- name: Report Release To OpsLevel
uses: opslevel/[email protected]
with:
Expand Down

0 comments on commit 27ea5c6

Please sign in to comment.