-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(release): add GitHub action config
- Loading branch information
Showing
1 changed file
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
name: Create Release | ||
|
||
jobs: | ||
release: | ||
name: Create Release | ||
runs-on: macos-latest | ||
steps: | ||
- name: Get the Version | ||
id: get_version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
- name: Checkout Source Code | ||
uses: actions/checkout@v2 | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.19 | ||
- name: Build | ||
run: | | ||
make dist VERSION=${{ steps.get_version.outputs.VERSION }} | ||
shell: bash | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: slack-exporter ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Upload Linux amd64 | ||
uses: actions/upload-release-assets@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: dist/${{ steps.get_version.outputs.VERSION }}/slack-exporter-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz | ||
asset_name: slack-exporter-${{ steps.get_version.outputs.VERSION }}-linux-amd64.tar.gz | ||
asset_content_type: application/octet-stream | ||
- name: Upload Linux arm64 | ||
uses: actions/upload-release-assets@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: dist/${{ steps.get_version.outputs.VERSION }}/slack-exporter-${{ steps.get_version.outputs.VERSION }}-linux-arm64.tar.gz | ||
asset_name: slack-exporter-${{ steps.get_version.outputs.VERSION }}-linux-arm64.tar.gz | ||
asset_content_type: application/octet-stream | ||
- name: Upload Darwin amd64 | ||
uses: actions/upload-release-assets@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: dist/${{ steps.get_version.outputs.VERSION }}/slack-exporter-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz | ||
asset_name: slack-exporter-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz | ||
asset_content_type: application/octet-stream | ||
- name: Upload Darwin arm64 | ||
uses: actions/upload-release-assets@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: dist/${{ steps.get_version.outputs.VERSION }}/slack-exporter-${{ steps.get_version.outputs.VERSION }}-darwin-arm64.tar.gz | ||
asset_name: slack-exporter-${{ steps.get_version.outputs.VERSION }}-darwin-arm64.tar.gz | ||
asset_content_type: application/octet-stream | ||
- name: Upload Windows amd64 | ||
uses: actions/upload-release-assets@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: dist/${{ steps.get_version.outputs.VERSION }}/slack-exporter-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz | ||
asset_name: slack-exporter-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz | ||
asset_content_type: application/octet-stream |