Skip to content

Commit

Permalink
ci(release): add GitHub action config
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmoneyc committed Oct 16, 2022
1 parent aeaab0b commit 68fd27f
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit 68fd27f

Please sign in to comment.