Release #78
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
name: Release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 9 * * 2' # every Tuesday at 9 am UTC | |
jobs: | |
release: | |
name: release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'zulu' | |
cache: maven | |
- name: Decode Keystore | |
id: decode_keystore | |
env: | |
fileName: ./keystore.jks | |
encodedString: ${{ secrets.KEYSTORE }} | |
run: | | |
echo "$encodedString" | base64 -d > $fileName | |
echo "6cab9fa86689a9969097a662891fe8a1d8752ac430c18750cfa4d230744ac4a7 $fileName" > sha256.txt | |
sha256sum -c sha256.txt | |
- name: Build with Maven | |
run: ./mvnw clean verify -P sign | |
env: | |
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }} | |
- name: Set up Git actions user | |
uses: fregante/setup-git-user@v1 | |
- name: Create release tag | |
id: createTag | |
run: | | |
TAG_NAME="v$(git show -s --format=%cd --date=format:%Y%m%d.%H%M%S)" | |
git tag | |
git push --tags | |
echo "::set-output name=tagName::$TAG_NAME" | |
- name: Authenticate to GCS | |
id: 'auth' | |
uses: 'google-github-actions/auth@v0' | |
with: | |
credentials_json: '${{ secrets.gcp_credentials_2 }}' | |
- name: Publish to Marketplace bucket | |
uses: 'google-github-actions/upload-cloud-storage@v0' | |
with: | |
path: "./update-site/target/repository/" | |
destination: "snyk-eclipse-plugin/weekly-2.1" | |
predefinedAcl: publicRead | |
- name: Extract release notes | |
id: extract-release-notes | |
uses: ffurrer2/extract-release-notes@v1 | |
- name: Create release | |
id: create_release | |
if: ${{ !env.ACT }} | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: "${{ steps.createTag.outputs.tagName }}" | |
release_name: "${{ steps.createTag.outputs.tagName }}" | |
draft: false | |
prerelease: false | |
body: '${{ steps.extract-release-notes.outputs.release_notes }}' | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./update-site/target/update-site-2.1.0-SNAPSHOT.zip | |
asset_name: "update-site-2.1.0-${{ steps.createTag.outputs.tagName }}.zip" | |
asset_content_type: application/zip |